0

Context: I'd like to save a list of dataframes to an excel file with several excel sheets in databricks. I'm aware the possible formats are JSON and CSV for example, but is there any way to save the excel file?

For example when doing this (input data is a csv file read using pyspark):

if sheet in sheet_names:
  
                        views_df[0].to_excel(
                            writer, sheet_name="{}_a".format(sheet), index=False),
                        views_df[1].to_excel(
                            writer, sheet_name="{}_b".format(sheet), index=False),
                        views_df[2].to_excel(
                            writer, sheet_name="{}_c".format(sheet))

How can I save the resulting excel file?

I'm using VS Code with a Databricks extension.

Chronicles
  • 436
  • 1
  • 11
  • Does this answer your question? [How in Scala/Spark create excel file with multiple sheets from multiple DataFrame?](https://stackoverflow.com/questions/57702508/how-in-scala-spark-create-excel-file-with-multiple-sheets-from-multiple-datafram) – samkart Nov 08 '22 at 07:00

0 Answers0