我需要将大量文件从.xls转换为.csv文件。 我尝试使用loop使其:
excel_files = glob.glob("A/2018/*xls")
for excel in excel_files:
out = excel.split('.')+'.csv'
df = pd.read_excel(excel)
df.to_csv(out)
我得到了一个错误:
TypeError Traceback (most recent call last)
<ipython-input-62-a04c590b0fd7> in <module>
1 for excel in excel_files:
----> 2 out = excel.split('.')+'.csv'
3 df = pd.read_excel(excel)
4 df.to_csv(out)
TypeError: can only concatenate list (not "str") to list
哪些变量以及如何更改
为此使用^{} 。特别是,^{} 方法提供了一种更改文件扩展名的简单方法
相关问题 更多 >
编程相关推荐