Skip to content

pd_utils.get_group_extreme fails if the data frame index is not unique #11

@bmmalone

Description

@bmmalone

The following is the problematic code:

if is_max:
        ex_vals = groups[ex_field].idxmax()
    elif is_min:
        ex_vals = groups[ex_field].idxmin()

    ex_rows = df.loc[ex_vals]

If the index of df is not unique, then the loc line can match multiple rows per group.

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