you can write to stringIO and then serve it. Attention: using StringIO will 
consume memory, so a dataframe weighting 100MB will raise your's app memory 
to something in the range of 250MB or so for EVERY request of download 
(counting 100MB for the original dataframe, another 100MB or so for the 
stringio csv representation and 50megs of normal utilization). It'd be a 
lot better to store the contents on a temp file that you delete some time 
later if you can write to the disk and if the dataframes are "huge".

On Friday, February 19, 2016 at 10:34:35 AM UTC+1, Paolo Amboni wrote:
>
> I've a pandas dataframe that i want to download as a csv file.
> I know that i can output a dataframe to a csv file : 
> dataframe.to_scv(path,sep)
> But how can a user download his generated file?
> Should i write it in a static directory, perhaps with the username prefix?
> Is there a way to generate a virtual file to download?
> Thanks!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to