Skip to content

Instantly share code, notes, and snippets.

@Shinichi-Nakagawa
Created April 6, 2015 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shinichi-Nakagawa/ebfd3789a6c082d38519 to your computer and use it in GitHub Desktop.
Save Shinichi-Nakagawa/ebfd3789a6c082d38519 to your computer and use it in GitHub Desktop.
イチローさんの打球割合
# matplotlibをimport
%matplotlib inline
from matplotlib import pyplot
# 自前で作ったライブラリをimport ※後日公開予定
from retrosheet import RetroSheet
from database_config import CONNECTION_TEXT, ENCODING, PARAMS
# イチローのプロフィール(2014年)を取得
retro = RetroSheet(CONNECTION_TEXT, ENCODING)
player = retro.find_player_by_fullname_year("Ichiro ", "Suzuki", 2014)
# 打球のグラフを描く
# フライ(Fly Ball), つまらないポップフライ(Pop Up), ゴロ気味の当たり(Ground Ball), 快心の当たり(Line Drive)
labels, values = retro.batted_ball_pie_data(player.PLAYER_ID, 20140401, 20141030)
pyplot.pie(values, labels=labels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment