import pandas as pd
def xlsx_to_csv_pd():data_xls = pd.read_excel('data1.xlsx', index_col=0)#data1为待转文件data_xls.to_csv('test2.csv', encoding='utf-8')#test1为转换后文件
if __name__ == '__main__':xlsx_to_csv_pd()
以上代码只需改注释处地址即可。
import pandas as pd
def xlsx_to_csv_pd():data_xls = pd.read_excel('data1.xlsx', index_col=0)#data1为待转文件data_xls.to_csv('test2.csv', encoding='utf-8')#test1为转换后文件
if __name__ == '__main__':xlsx_to_csv_pd()
以上代码只需改注释处地址即可。