Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use shared uploaded file on Google Colab

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!

like image 290
Phong The Ha Avatar asked Apr 23 '18 00:04

Phong The Ha


People also ask

How do I use uploaded data on Google Colab?

It will prompt you to select a file. Click on “Choose Files” then select and upload the file. Wait for the file to be 100% uploaded. You should see the name of the file once Colab has uploaded it.

Can Google colab access local files?

Colaboratory lets you connect to a local runtime using Jupyter. This allows you to execute code on your local hardware and have access to your local file system.


1 Answers

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.

like image 78
korakot Avatar answered Sep 21 '22 14:09

korakot