简体   繁体   English

下载 padas dataframe

[英]Downloading padas dataframe

Using Python, Azure functions I am generating df.使用 Python、Azure 函数我正在生成 df。 Now I want to download it (save it) on local machine as excel.现在我想将它下载(保存)在本地机器上,作为 excel。

Azure function is http trigger. Azure function 是 http 触发器。 Whenever function is triggered file should be downloaded.每当触发 function 时,都应下载文件。 Anyone with idea how this could be achieved?任何人都知道如何实现这一目标?

Once your data frame is completed and the browser triggers the function, the function should have the below code in it.一旦您的数据框完成并且浏览器触发 function,function 中应该包含以下代码。 .to_excel changes the dataframe existing in your code to an excel document at the location you enter into the file path you provide. .to_excel 将代码中现有的 dataframe 更改为 excel 文档,位于您输入文件路径的位置。

df.to_excel(filepath)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM