pybaseball icon indicating copy to clipboard operation
pybaseball copied to clipboard

Way to filter players by league?

Open rmatts94 opened this issue 2 years ago • 2 comments

Suppose I wanted players that only played in either the AL or NL? Is there a way to do that? Including situations where a player played for multiple teams?

rmatts94 avatar Feb 20 '23 19:02 rmatts94

In some of the data sources there is a column for which league they are in.

I would throw them into a pandas dataframe and then sort/ them by league.

ghost avatar Mar 05 '23 22:03 ghost

@imzackadams is right here, particularly for the team_batting, team_pitching, etc functions. Otherwise, I think I'd just make a dictionary and merge it to the DF. Did you figure out how to get what you need?

tjburch avatar Mar 09 '23 16:03 tjburch