LoginSignup
0
0

More than 3 years have passed since last update.

ツール整理:Google Colaboratory (2020.2.24更新)

Last updated at Posted at 2020-02-24

目的

  • SIGNATEやNishikaなどの国内の分析コンペは、計算プラットフォームがないので、自前のノートPCでは辛くなってきた。そこで、GoogleColaboratoryの自分用の使い方メモ。
    Kaggleは計算プラットフォームがあるので、問題ない。

  • 都度、更新していく予定 2020.2.24

    • テンプレート作成

目次

  1. テンプレート

1. テンプレート

  • 「XXX」、「../input/data」を自分のフォルダに、書き換えて使用する。
  • 内容
    1. Google Driveにマウント
    2. 経過時間表示
import os
path = None
# プラットフォーム判定
# nt:Windows系 , それ以外Google Colab
if os.name == 'nt':
    # ローカルフォルダ
    path = '../input/data/'
else:
    # (1)Google Driveにマウント
    from google.colab import drive
    drive.mount('/content/drive')
    !ls drive/My\ Drive/'Colab Notebooks'/XXX/input/data
    path = "./drive/My Drive/Colab Notebooks/XXX/input/data/"
    # (2)経過時間確認 (12時間ルール用)
    !cat /proc/uptime | awk '{print $1 /60 /60 /24 "days (" $1 / 60 / 60 "h)"}'

print('os:',os.name)
print('path:',path)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0