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
728x90
'Data Science > Python' 카테고리의 다른 글
[Python] NLP : TreebankWordTokenizer, Pos Tag (0) | 2022.09.17 |
---|---|
[python] ML Model Parameter Optimization : GridSearchCV (0) | 2022.09.17 |
[python] dataframe apply() multiprocessing (0) | 2022.09.05 |
[python] 그래프에서 두 좌표의 거리 계산 (0) | 2022.09.05 |
[python] Deepcopy a list (array) (0) | 2022.09.01 |
최근댓글