python csv转换为excel
import pandas as pdimport openpyxldef csv_to_xlsx_pd():csv = pd.read_csv(r'C:1.csv', encoding='utf-8')csv.to_excel(r'C:\1.xlsx', sheet_name='data')if __name__ == '__main__':csv_to_xlsx_pd()
·
import pandas as pd import openpyxl def csv_to_xlsx_pd(): csv = pd.read_csv(r'C:1.csv', encoding='utf-8') csv.to_excel(r'C:\1.xlsx', sheet_name='data') if __name__ == '__main__': csv_to_xlsx_pd()
更多推荐
已为社区贡献8条内容
所有评论(0)