Created
March 17, 2019 14:41
-
-
Save Mukei/05c0ca1317d3926c070318ff2f1973f0 to your computer and use it in GitHub Desktop.
Some Python command to use Kaggle on Colab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To access kaggle datasets | |
!pip install kaggle | |
# Import data from Kaggle | |
# Colab's file access feature | |
from google.colab import files | |
# Retrieve uploaded file | |
uploaded = files.upload() | |
# Print results | |
for fn in uploaded.keys(): | |
print('User uploaded file "{name}" with length {length} bytes'.format( | |
name=fn, length=len(uploaded[fn]))) | |
# Then move kaggle.json into the folder where the API expects to find it. | |
!mkdir -p ~/.kaggle/ && mv kaggle.json ~/.kaggle/ && chmod 600 ~/.kaggle/kaggle.json | |
# List kaggle project | |
!kaggle competitions list | |
#donwload earthquake data (for example... | |
!kaggle competitions download -c LANL-Earthquake-Prediction | |
#unzip training data for usage | |
!ls | |
!unzip train.csv.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment