I just want to grab some output data from a Google Cloud Datalab notebook quickly, preferably as a throwaway CSV file.
I've done this:
writer = csv.writer(open('output.csv', 'wb'))
for row in rows:
writer.writerow(row)
This writes a local file, but then I can't either open it in the browser, or (see how to) download it from Cloud Datalab.
How can I quickly grab my data as a CSV file? I guess maybe I have to use the Storage APIs and write it ? I'm finding the docs a bit hard to follow, I've got something like this:
import gcp
import gcp.storage as storage
// create CSV file? construct filepath? how?
mybucket = storage.Bucket(myfile)
mybucket.create()