How do I save excel file with multiple sheets from pyspark data frame in ADLS Gen2

506 views
Skip to first unread message

python Learner

unread,
Feb 11, 2021, 6:47:30 AM2/11/21
to Delta Lake Users and Developers

I'm working in pyspark 3.0.1 on data bricks. I have two pyspark data frame,df1 & df2, which I need to save in two sheet of an excel file in ADLS gen2. So I wrote the following script

  1. writer = pd.ExcelWriter(path+"multipleSheet.xlsx", engine='xlsxwriter')
  2. df1.toPandas().to_excel(writer, sheet_name='df1')
  3. df2.toPandas().to_excel(writer, sheet_name='df2')
  4. writer.save()

where path is my ADLS path. Unfortunately I'm not finding error while running the code & also not seeing the excel file in my ADLS. But the same code is working in local & generating excel file with multiple tab.

Is there any other option for ADLS to save excel file with multiple tabs

Reply all
Reply to author
Forward
0 new messages