import dataset into google colab from another drive account
To download a file to Colab
If you want to download the file directly into your Google Colab instance, then you can use gdown
.
Note that the file must be shared to the public.
If the link to your dataset is https://drive.google.com/file/d/10vAwF6hFUjvw3pf6MmB_S0jZm9CLWbSx/view?usp=sharing
, you can use:
!gdown --id "10vAwF6hFUjvw3pf6MmB_S0jZm9CLWbSx"
To download the file to your Drive
Instead, if you want to download it to your drive then
Mount your Google Drive
from google.colab import drive
drive.mount('/content/drive')
Change the directory to a folder in your Google Drive
cd '/content/drive/My Drive/datasets/'
Download the file into your Google Drive folder
!gdown --id "10vAwF6hFUjvw3pf6MmB_S0jZm9CLWbSx"
To download a folder
If you are trying to download a folder, follow these steps:
- Open the shared folder
- Click "Add shortcut to my drive" and select a folder
Mount your Google Drive to Google Colab
Go to the folder where you added the shortcut
You can see the newly-added folder, being referenced by its Google Drive folder ID.