I have NBA data for every game played until January of 2023. I went ahead and combined all the points and now have it as this:
I used the groupby function to sum up total PTS
I wanted to filter the dataframe to show the most points scored by a player for a given season. For example:
Season | Name | Pts |
---|---|---|
2022 | Player 1 | 2938 |
2021 | Player 2 | 2111 |
most_points = nba_data.groupby(by=['Season', 'Name'])[['Pts']].sum()
most_points.sort_values(by='Pts', ascending=False)