Forum Discussion
save data in excel
- Anonymous2 years ago
Hi Anonymous
I am adding the code snippet here:import pandas as pd df = spark.sql("SELECT * FROM lakehouse_1.customers_1000") df1= df.toPandas() df1.to_excel('abfss://[email protected]/lakehouse_1.Lakehouse/Files/sample.xlsx')
Just replace with the abfss path of your lakehouse files folder.
Hope this helps.
can you please send the pyspark equivalent to your notebook code?
thank you
Hi Anonymous
I am adding the code snippet here:
import pandas as pd
df = spark.sql("SELECT * FROM lakehouse_1.customers_1000")
df1= df.toPandas()
df1.to_excel('abfss://[email protected]/lakehouse_1.Lakehouse/Files/sample.xlsx')
Just replace with the abfss path of your lakehouse files folder.
Hope this helps.
- Anonymous2 years agoNot applicable
now that I can save the dataframe as .xlsx, how do I open the excel file which is now in the Files folder?
my goal is to eventually email this excel file to someone
thanks
- Anonymous2 years agoNot applicable
Hi Anonymous
As specified above you can use Onelake explorer in your local machine to download the file. Then you can send it via email.You can also download this file into your local desktop using Onelake explorer.
Access Fabric data locally with OneLake file explorer - Microsoft Fabric | Microsoft LearnDownload the latest version of Onelake explorer and sync the Lakehouse.
Hope this helps. Please let me know if you have any further questions.
- Anonymous2 years agoNot applicable
Hi Anonymous
Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.