There are two ways you can upload the dataset in google colab, if the dataset is in your local system.
- You can upload your dataset to your Google drive.
And the simplest way to share files is to mount your Google Drive in your Google Colab notebook.
To do this, run the following in a code cell:
from google.colab import drive
drive.mount('/content/drive')
It will ask you to visit a link to ALLOW "Google Files Stream" to access your drive. After that, a long alphanumeric auth code will be shown that needs to be entered in your Colab's notebook.
Afterward, your Drive files will be mounted and you can browse them with the file browser in the side panel.
- You can upload files manually by browsing to your local file system
It takes a longer time to upload in this method.
from google.colab import files
uploaded = files.upload()
Here are two examples for your reference:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…