Python自编工具函数
作者:互联网
import pandas as pd
def xlsx_to_csv(filepath, chinese=False):
'''将excel xlsx文件转化为csv文件
'''
fileName = filepath.rsplit(".", 1)[0]
outName = fileName + '.csv'
file = pd.read_excel(filepath)
print(file.head())
if chinese:
file.to_csv(outName, encoding='utf_8_sig', index=False)
else:
file.to_csv(outName, index=False)
标签:outName,False,函数,chinese,filepath,Python,自编,file,csv 来源: https://www.cnblogs.com/malcolmwallace/p/14994769.html