Note
Click here to download the full example code
Baseball Reference WARΒΆ
Out:
name_common age mlb_ID ... OPS_plus TOB_lg TB_lg
0 David Aardsma 22.0 430911.0 ... NaN 0.000 0.000
1 David Aardsma 24.0 430911.0 ... -100.0000 0.694 0.896
2 David Aardsma 25.0 430911.0 ... NaN 0.000 0.000
3 David Aardsma 26.0 430911.0 ... -100.0000 0.345 0.434
4 David Aardsma 27.0 430911.0 ... NaN 0.000 0.000
... ... ... ... ... ... ... ...
108010 Dutch Zwilling 26.0 124791.0 ... 142.1034 199.044 188.238
108011 Dutch Zwilling 27.0 124791.0 ... 7.3437 18.514 18.751
108012 Tony Zych 24.0 543964.0 ... NaN 0.000 0.000
108013 Tony Zych 25.0 543964.0 ... NaN 0.000 0.000
108014 Tony Zych 26.0 543964.0 ... NaN 0.000 0.000
[108015 rows x 49 columns]
name_common age mlb_ID ... OPS_plus TOB_lg TB_lg
84981 Babe Ruth 28.0 121578.0 ... 239.1529 252.509 211.045
84979 Babe Ruth 26.0 121578.0 ... 238.6033 253.690 229.122
106923 Carl Yastrzemski 27.0 124650.0 ... 193.4291 219.589 219.383
84985 Babe Ruth 32.0 121578.0 ... 225.0409 242.569 220.158
44940 Rogers Hornsby 28.0 116156.0 ... 222.0546 214.622 214.507
8882 Barry Bonds 36.0 111188.0 ... 258.7176 219.120 202.824
[6 rows x 49 columns]
name_common age mlb_ID ... WAR_rep ERA_plus ER_lg
21517 Walter Johnson 25.0 116635.0 ... 3.5162 258.925000 113.927
21516 Walter Johnson 24.0 116635.0 ... 3.7861 242.798246 138.395
15755 Dwight Gooden 20.0 114947.0 ... 2.5333 228.665957 107.473
6580 Steve Carlton 27.0 112008.0 ... 3.0028 182.243421 138.505
7878 Roger Clemens 34.0 112388.0 ... 2.6641 221.573333 132.944
534 Pete Alexander 33.0 110127.0 ... 2.9949 166.094805 127.893
[6 rows x 43 columns]
from pybbda.data import BaseballReferenceData
bbref_data = BaseballReferenceData()
print(bbref_data.war_bat)
print(bbref_data.war_bat.sort_values("WAR", ascending=False).head(6))
print(
bbref_data.war_pitch.query("year_ID >= 1911")
.sort_values("WAR", ascending=False)
.head(6)
)
Total running time of the script: ( 0 minutes 1.375 seconds)