简体   繁体   中英

Best way to read and write data on google colab?

I'm making an application that shows the correlation between your daily habits and your mood. Because python has so many of the components I need and I wan't this to be web based (also I'm not worried about the front end right now) I'm leaning towards using colab.

The problem is the session storage. I know how to work with pre-existing data but I'm totally unfamiliar with storing collected data with python. It's a light weight app and I'd like to use the panda's library to visualize the data.

The point is: I don't know how I should store the data that will be input on a daily basis on colab for future use. Of course, every time I run the colab, data collected will be cleared. What's the best way to store data from each use on colab? Can I create a csv file on my google drive and read / write to that file and if so what's the best method?

If colab seems like a bad option, I'll use javascript to collect the data & d3.js to visualize but I'd like to stick to colab if I can so I don't have to stand up my own webpage.

Since you want it to be web-based, you can use Heroku Student Plan with Github Education or PythonAnywhere . Because the colab session will stop after 12 hours and it is a headache to run it again.

In case, you still want to use Colab, one way is to save data into a file and keep it in Google Drive. In this case, Saving of data can be automated. But you'll need to get access token for Google Drive every session. Check Example I/O notebook

Other methods are generally inconvenient

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM