Skip to Content
Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
book

Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

by Jake VanderPlas, 菊池 彰
May 2018
Intermediate to advanced
556 pages
13h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from Pythonデータサイエンスハンドブック ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習
3.11
 文字列操作のベクトル化
185
3.11.3
 事例:レシピデータベース
ここまでに学んだベクトル化文字列演算は、乱雑な現実のデータを整理する作業において非常に
有用です。ここでは、ウェブ上のさまざまなソースから蓄積されたオープンなレシピデータベース
を使用して、使い方の例を説明します。私たちの目標はレシピデータから材料のリストを取り出す
ことで、手持ちの食材から作れる料理を素早く見つけられるようにすることです。
こうしたデータを操作するためのスクリプトは
https://github.com/fictivekin/openrecipes
にあ
り、最新バージョンのデータベースへのリンクもそこにあります
1
2016
年春の時点で、このデータベースは約
30MB
の大きさを持ち、次のコマンドでダウンロー
ドと解凍ができます。
In[17]: # !curl -O http://openrecipes.s3.amazonaws.com/recipeitems-latest.json.gz
# !gunzip recipeitems-latest.json.gz
データベースは
JSON
形式なので、
pd.read_json
を使って読み込みます。
In[18]: try:
recipes = pd.read_json('recipeitems-latest.json')
except ValueError as e:
print("ValueError:", e)
ValueError: Trailing data ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Pythonデータサイエンスハンドブック 第2版 ―Jupyter、NumPy、pandas、Matplotlib、scikit-learnを使ったデータ分析、機械学習

Jake VanderPlas, 菊池 彰
初めてのGraphQL ―Webサービスを作って学ぶ新世代API

初めてのGraphQL ―Webサービスを作って学ぶ新世代API

Eve Porcello, Alex Banks, 尾崎 沙耶, あんどうやすし

Publisher Resources

ISBN: 9784873118413Other