Python Pandas读取和写入excel文件 Pandas读取excel文件 df = pd.read_excel(filename,sheet_name = sheetname,header=0) df.head() 其中sheet_name可省略,,默认读取是第一个工作薄 pandas写入excel文件 将整个dataframe写入Excel文件中 df.to_excel(filename