簡體   English   中英

返回一個數據幀作為結果 Flask

[英]Return a dataframe as result Flask

我用燒瓶。 我想返回一個數據幀作為結果。 但我收到這個錯誤。

TypeError: The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a DataFrame. 

將響應頭設置為text/csv

resp.headers["Content-Disposition"] = "attachment; filename=export.csv"
resp.headers["Content-Type"] = "text/csv"
return resp

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM