Reputation: 5310
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?
Upvotes: 0
Views: 971
Reputation: 38639
Yes, there are several options:
google.colab.files
module to download like so: from google.colab import files
files.download('csv')
Upvotes: 1