import pandas as pd
def xlsx_to_csv_pd():
"""
xlsx 转 csv
:return:
"""
data_xls = pd.read_excel('2018.12.xlsx', index_col=0)
data_xls.to_csv('2018.12.csv', encoding='utf-8')
def csv_to_xlsx_pd():
"""
csv 转 xlsx
:return:
"""
csv = pd.read_csv('2019.01.csv', encoding='utf-8')
csv.to_excel('1.xlsx', sheet_name='data')
if __name__ == '__main__':
xlsx_to_csv_pd()
csv_to_xlsx_pd()
文章评论