How to Load Kaggle Datasets Directly into Google Colab?

1. Select any dataset from Kaggle.

2. Download API Credentials

Account ->  API -> Create New API Token

3. Setup the Colab Notebook

4. Set up colab

1. Install the Kaggle library

! pip install kaggle
2. Make a directory named “.kaggle”

! mkdir ~/.kaggle
3. Copy the “kaggle.json” into this new directory

! cp kaggle.json ~/.kaggle/
4. Allocate the required permission for this file.

! chmod 600 ~/.kaggle/kaggle.json

5. Download the dataset

Downloading Competitions dataset:

! kaggle competitions download <name-of-competition>

Downloading Datasets:

! kaggle datasets download <name-of-dataset>