We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fangraphs pitching data appears to be missing many players. Here's a code snippet:
import pybaseball pstats = pybaseball.pitching_stats(2021) print(f"Rows for fangraphs pitching stats for 2021: {len(pstats)}") pstats_bref = pybaseball.pitching_stats_bref(2021) print(f"Rows for Baseball Reference pitching stats for 2021: {len(pstats_bref)}") player_ids = pybaseball.playerid_reverse_lookup([593334], key_type="mlbam").iloc[0] print(player_ids) fg_stats = pstats.loc[pstats["IDfg"] == player_ids["key_fangraphs"]] print(f"Fangraphs rows for pitcher Domingo Germán: {len(fg_stats)}") bref_stats = pstats_bref.loc[pstats_bref["Name"].str.contains("Domingo")] print(f"Baseball Reference rows for pitcher Domingo Germán: {len(bref_stats)}")
And the output I get:
Rows for fangraphs pitching stats for 2021: 66 Rows for Baseball Reference pitching stats for 2021: 646 Gathering player lookup table. This may take a moment. name_last german name_first domingo key_mlbam 593334 key_retro germd001 key_bbref germado01 key_fangraphs 17149 mlb_played_first 2017.0 mlb_played_last 2021.0 Name: 0, dtype: object Fangraphs rows for pitcher Domingo Germán: 0 Baseball Reference rows for pitcher Domingo Germán: 2
66 pitchers for the whole season of 2021 is way too low. Fangraphs has Domingo's data: https://www.fangraphs.com/players/domingo-german/17149/stats?position=P as well.
It looks like the code is just querying the "Leaders" section of Fangraphs
pybaseball/pybaseball/datasources/fangraphs.py
Line 45 in bbd03a8
Based on the documentation, I'd expect pitching_stats to have data for all players from the season. Is that wrong?
pitching_stats
The text was updated successfully, but these errors were encountered:
Whoops! Out of date documentation, but see #213 which fixes this.
Sorry, something went wrong.
and so @michaelmdresser here's your fix:
pstats = pybaseball.pitching_stats(2021, qual=1)
Thank you!
No branches or pull requests
Fangraphs pitching data appears to be missing many players. Here's a code snippet:
And the output I get:
66 pitchers for the whole season of 2021 is way too low. Fangraphs has Domingo's data: https://www.fangraphs.com/players/domingo-german/17149/stats?position=P as well.
It looks like the code is just querying the "Leaders" section of Fangraphs
pybaseball/pybaseball/datasources/fangraphs.py
Line 45 in bbd03a8
Based on the documentation, I'd expect
pitching_stats
to have data for all players from the season. Is that wrong?The text was updated successfully, but these errors were encountered: