Issue
I'm trying to download a pandas dataframe directly from colab's memory INSTEAD of saving that dataframe to drive as a csv then using the files library to download that file.
import pandas as pd
import numpy as np
data = pd.DataFrame(np.random.random(10))
data.to_csv()
This block of code generates a formatted example I just need something that will give me a dialog box so I can save that object locally.
The reason behind this is I'm developing a shared notebook that others will use to generate data and I don't want have the users saving all kinds of stuff to my drive. Is what I'm asking for currently possible?
Solution
Yes, there are several options:
- Use the
google.colab.files
module to download like so:
from google.colab import files
files.download('csv')
- Right click on the file in the file browser and select download like so:
Answered By - Bob Smith
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.