to_excel(self, excel_writer, sheet_name='Sheet1', na_rep='', float_format=None,columns=None, header=True, index=True, index_label=None,startrow=0, startcol=0, engine=None, merge_cells=True, encoding=None,inf_rep='inf', verbose=True, freeze_panes=None)
- 参数
excel_writer
:文件保存的路径import pandas as pd x = pd.DataFrame(data) x.to_excel('data.xls')
- 参数
sheet_name
:就是表格中的sheet名,默认Sheet1import pandas as pd x = pd.DataFrame(data) x.to_excel('data.xls',sheet_name='data')