我正在将数据框导出到Excel并有条件地用颜色对其进行格式设置(所以对我而言没有PyExcelerate),到目前为止,转换到Pandas最多的时间是我在想,是否有办法使用spark dataframe,代码是这样的:
excel_writer_global = pd.ExcelWriter("excel_output.xlsx", engine='xlsxwriter')
# Create a Pandas dataframe from some data.
print_seconds_since_start("To pandas")
pd_df_a_escribir = df_a_escribir.toPandas()
print_seconds_since_start("Fin to pandas")
# Convert the dataframe to an XlsxWriter Excel object.
pd_df_a_escribir.to_excel(excel_writer, sheet_name=name_hoja)
# Get the xlsxwriter workbook and worksheet objects.
workbook = excel_writer.book
worksheet = excel_writer.sheets[name_hoja]
这必须是一个更快的解决方案,因为这是当前的问题, 提前非常感谢!