0

Using Python, Azure functions I am generating df. Now I want to download it (save it) on local machine as excel.

Azure function is http trigger. Whenever function is triggered file should be downloaded. Anyone with idea how this could be achieved?

choka
  • 30
  • 5
  • There is no code posted so it's hard to say exactly where you are in the process. If you have already coded the file to generate a dataframe, than you should be able to use the built in .to_excel(filepath). – Omnishroom Sep 29 '22 at 16:06
  • I have created dataframe, that where I ended up. Now I want, when function is triggered from browser to download dataframe as excel to my local machine. – choka Sep 29 '22 at 16:09
  • Welcome to StackOverflow. Please take the [tour](https://stackoverflow.com/tour) and learn [How to Ask](https://stackoverflow.com/help/how-to-ask). In order to get help, you will need to provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). If your question include a pandas dataframe, please provide a [reproducible pandas example](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) – alec_djinn Sep 29 '22 at 16:19

1 Answers1

0

Once your data frame is completed and the browser triggers the function, the function should have the below code in it. .to_excel changes the dataframe existing in your code to an excel document at the location you enter into the file path you provide.

df.to_excel(filepath)
Omnishroom
  • 253
  • 1
  • 8
  • function is hosted on server. does filepath of my local machine will work in that case? – choka Sep 29 '22 at 16:20