イチローさんの打球割合
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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