PyCharm 将多个 df 导出到单个 csv 文件
PyCharm export multiple df's to a single csv file
我正在 PyCharm 移动我的代码。我的代码在 Pandas 的 ExcelWriter 方法上失败了。在 pyCharm 中无法将多个数据帧导出到 csv?
excel_writer = pd.ExcelWriter('Out_RFQ_Status_1_' + REGION + '.xlsx')
import pandas as pd
# Create some Pandas dataframes from some data.
df1 = pd.DataFrame({'Data': [11, 12, 13, 14]})
df2 = pd.DataFrame({'Data': [21, 22, 23, 24]})
df3 = pd.DataFrame({'Data': [31, 32, 33, 34]})
# Create a Pandas Excel writer using XlsxWriter as the engine.
writer = pd.ExcelWriter('pandas_multiple.xlsx', engine='xlsxwriter')
# Write each dataframe to a different worksheet.
df1.to_excel(writer, sheet_name='Sheet1')
df2.to_excel(writer, sheet_name='Sheet2')
df3.to_excel(writer, sheet_name='Sheet3')
# Close the Pandas Excel writer and output the Excel file.
writer.save()
来源:ExcelWriter
我正在 PyCharm 移动我的代码。我的代码在 Pandas 的 ExcelWriter 方法上失败了。在 pyCharm 中无法将多个数据帧导出到 csv?
excel_writer = pd.ExcelWriter('Out_RFQ_Status_1_' + REGION + '.xlsx')
import pandas as pd
# Create some Pandas dataframes from some data.
df1 = pd.DataFrame({'Data': [11, 12, 13, 14]})
df2 = pd.DataFrame({'Data': [21, 22, 23, 24]})
df3 = pd.DataFrame({'Data': [31, 32, 33, 34]})
# Create a Pandas Excel writer using XlsxWriter as the engine.
writer = pd.ExcelWriter('pandas_multiple.xlsx', engine='xlsxwriter')
# Write each dataframe to a different worksheet.
df1.to_excel(writer, sheet_name='Sheet1')
df2.to_excel(writer, sheet_name='Sheet2')
df3.to_excel(writer, sheet_name='Sheet3')
# Close the Pandas Excel writer and output the Excel file.
writer.save()
来源:ExcelWriter