【发布时间】:2020-07-05 16:30:25
【问题描述】:
我已经为变量分配了不同的文件。现在我想做一些迭代这些变量的操作。例如:
reduced_file1= 'names.xlsx'
reduced_file2= 'surnames.xlsx'
reduced_file3= 'city.xlsx'
reduced_file4= 'birth.xlsx'
我想要迭代的操作(使用 FOR 循环)是:
xls= pd.ExcelFile(reduced_file1)
xls= pd.ExcelFile(reduced_file2)
xls= pd.ExcelFile(reduced_file3)
xls= pd.ExcelFile(reduced_file4)
...等等
基本上每次都是改变量名:reduce_file(i)
谢谢
【问题讨论】:
-
这远低于stackoverflow问题的水平
标签: python pandas jupyter-notebook