2017-02-01から1ヶ月間の記事一覧

Pandas Cheatsheet

数ヶ月ぶりにpandasを使うと基本すら忘れていることが多いので、チートシートを残しておきます。 なお、pandas (0.18.1) です。 データの読み込み csvから読み込む。 先頭行のヘッダは自動で読み込んでくれます。 import pandas as pd df_train = pd.read_cs…

capistrano3でshared_pathにディレクトリを作成する

いつも忘れるので、メモっておく。 namespace :tmp_dir do task :create do on roles(:all) do within shared_path do unless test "[ -e tmp/subdir]" execute :mkdir, "-p", "tmp/subdir" end end end end end after "deploy:check", "tmp_dir:create"