Skip to content

.agg() Issue in NFL Suspensions Data Analysis Program #1

@Kyle-Pu

Description

@Kyle-Pu

In groupingAndSorting.py, line 23 calls longSuspense = suspensions.groupby(['team']).games.agg([min, max]) which should gather data together by the team column and proceed to find the minimum and maximum number in the games column for each team.

Right now, however, the output shows some incorrect values for min and max. Also, some of the minimums are greater than the maximums for each team (e.g. for team ARI, it shows a minimum of 16 for games while showing a 4 for maximum for games).

We need to correctly output the data in this format:
[Team Name] [Minimum of the numbers in the game column for that team] [ Maximum of the numbers in the game column for that team].

Currently, the only correct part is that the rows for each team have been grouped together.

Any help is greatly appreciated!

Update:
I think it's an issue with the groupby object because when I run `suspensions.groupby("team").games.min(), it returns the same min values agg produces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions