728x90

 

'kaggle' module Installation 

!pip install --upgrade --force-reinstall --no-deps kaggle

Create a kaggle.json file & Setup.

#from google.colab import files
#files.upload()
import json 
import os
from pathlib import Path

# uses pathlib Path
kaggle_path = Path('/root/.kaggle')
os.makedirs(kaggle_path, exist_ok=True)

# checking : kaggle login - accounts - Create New API token
data = '{"username":"{user name}","key":"{your key}"}'
# opens file and dumps python dict to json object 
with open (kaggle_path/'kaggle.json', 'w') as f:
    f.write(data)

os.chmod(kaggle_path/'kaggle.json', 600)

Download dataset  in kaggle.

"feedback-prize-english-language-learning"  dataset dowanload example : 

 

!kaggle competitions download -c feedback-prize-english-language-learning

Unzip

!unzip feedback-prize-english-language-learning.zip -d feedback-prize-english-language-learning

 

Kaggle Dataset Load in Colab : file list

728x90
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기
반응형