条件にpassがある関数をapplyするとNaNが返ってくる[Python][Pandas]
![Thumbnail of post image 084](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/bram-van-oost-6WvZo5FOxww-unsplash.jpg?resize=150%2C150&ssl=1)
import pandas as pddef func(row): if row < 3: return row + row else: passdf = pd.DataFrame({'A':,'B':,'C':})df = df.a ...
pandasで自作関数をapplyするときはaxis=1を設定する[Pandas][Python]
![Thumbnail of post image 185](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/anna-sullivan-IUXR0sqs-mY-unsplash.jpg?resize=150%2C150&ssl=1)
import pandas as pddef func(row): if row < 3: return row + row else: return row + rowdf = pd.DataFrame({'A':,'B':,'C' ...
動詞の原型を取得 [Python]
![Thumbnail of post image 159](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/lex-sirikiat-nV19ucDBbs8-unsplash.jpg?resize=150%2C150&ssl=1)
なぜかimportの仕方によって、出力結果が異なる
以下のimportだと、sinteringはsinterに変換されるが、heatingはheatにならない。
from nltk.corpus import wor ...関係に重みをつける方法[Py2neo][Neo4j]
![Thumbnail of post image 128](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/samantha-gades-BlIhVfXbi9s-unsplash.jpg?resize=150%2C150&ssl=1)
from py2neo import Graphfrom py2neo import Node, Relationshipuser = 'neo4j'pwd = 'neo4j'graph = Graph(auth=(user, pwd)) ...
A Machine Learning Approach to Zeolite Synthesis Enabled by Automatic Literature Data Extraction
![Thumbnail of post image 115](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/bram-van-oost-6WvZo5FOxww-unsplash.jpg?resize=150%2C150&ssl=1)
論文の本文と表から、正規表現を用いて材料の原子数を抽出し、その原子数からZeolite材料の密度(Density)の高さを推定
RandomErasingを挿入する位置に注意[Pytorch]
![Thumbnail of post image 012](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/mockaroon-bzLhhI3MpYY-unsplash.jpg?resize=150%2C150&ssl=1)
torchvision.transforms.RandomErasing の引数は torch.Tensor なので、torchvision.transforms.ToTensor によって変換しておかなければならない
正 ...
kaggleの環境をdockerで再現
![Thumbnail of post image 028](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/taylor-heery-71sp4JBYO-U-unsplash-2.jpg?resize=150%2C150&ssl=1)
Dockerfileの取得
上のリンクからgit cloneでkaggle環境のdockerfileを取得。
git clone先ほどcloneしたリポジトリ内に移り、imageを作成する。最後のbu
Kaggle api 要点だけ
![Thumbnail of post image 035](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/link-hoang-UoqAR2pOxMo-unsplash.jpg?resize=150%2C150&ssl=1)
インストールpip install kaggle
kaggleを入力すると、ユーザ情報を登録するよう求められ、そのパスも表示される。
トークンはkaggleにwebログインし、my account >> create ...
Slack通知、2行で [Python]
![Thumbnail of post image 061](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/xps-DYAf-8UTFN8-unsplash.jpg?resize=150%2C150&ssl=1)
import slackwebslack = slackweb.Slack(url="Webhook URL")slack.notify(text="This is message for you.")
参照
AWS Cloud9でdockerのssh化を行うときは注意
![Thumbnail of post image 135](https://i0.wp.com/vasteelab.com/wp-content/uploads/2020/07/samuel-yongbo-kwon-wrQsfMKwElI-unsplash.jpg?resize=150%2C150&ssl=1)
にチュートリアルがあるが、これに従うと以下のエラーが発生。
Size of file/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty-updates_res ...