How to use shared uploaded file on Google Colab

Phong The Ha picture Phong The Ha · Apr 23, 2018 · Viewed 7.6k times · Source

I am using Google Colab with my friend for a group project. I uploaded a csv file and had pandas read it as a dataframe:

from google.colab import files
uploaded = files.upload()
import io
df = pd.read_csv(io.StringIO(uploaded['cumulative.csv'].decode('utf-8')))

However, when I shared the notebook with my friend, he could not use the uploaded df. I was wondering if there was anyway to fix this? Or does Google colab simply not have the sharing files feature?

Thank you!

Answer

korakot picture korakot · Apr 23, 2018

The sharing feature is on the code (notebook) only. But you and your friend each run the code in a separate instance machine. So, if you want to share, it's best to use reading from Google Drive that each of you can do oneself.