Skip to content

Instantly share code, notes, and snippets.

@Shinichi-Nakagawa
Created July 11, 2015 12:24
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/dfd3dcbe3cad3c53ac11 to your computer and use it in GitHub Desktop.
Save Shinichi-Nakagawa/dfd3dcbe3cad3c53ac11 to your computer and use it in GitHub Desktop.
hideki_matsui.py
#IPython notebookに貼り付けて実行
%matplotlib inline
import csv
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from retrosheet_util import RetroSheetUtil
from analyze_batter import AnalyzeBatter
# 2004年および2011年の松井秀喜成績データを読み込む
df2004 = pd.read_csv('./data/hideki_matsui_2004.csv')
df2011 = pd.read_csv('./data/hideki_matsui_2011.csv')
# 分析用のUtilクラス(引数:RETROSHEETを取り扱う用のUtilクラス)
analyzer = AnalyzeBatter(RetroSheetUtil)
# 内野・外野に飛んだ打球をヒットの種類ごとに数え上げ
hit_charts2004 = analyzer.hit_charts(df2004)
hit_charts2011 = analyzer.hit_charts(df2011)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment