标签:div sheet style int bsp python das sig one
利用pandas库将excel转换成csv格式
import pandas as pd df=pd.read_excel("D:\张香婷\python\Python1.xlsx",index_col=None,na_values=[‘dgf‘]) df.to_csv(‘D:\张香婷\python\Python1.csv‘,encoding="utf_8_sig") df=pd.read_csv(‘D:\张香婷\python\Python1.csv‘,engine=‘python‘) print(df)
或 import pandas as pd def csv_to_xlsx_pd(): csv = pd.read_csv(‘1.csv‘, encoding=‘utf-8‘) csv.to_excel(‘1.xlsx‘, sheet_name=‘data‘) if __name__ == ‘__main__‘: csv_to_xlsx_pd()
标签:div sheet style int bsp python das sig one
原文地址:https://www.cnblogs.com/SGzhang/p/10809788.html