Skip to content

BUG: np.min on DataFrame with a non-ordered Categorical col #28949

Closed
@jbrockmendel

Description

@jbrockmendel

Discovered while debugging the try/excepts in groupby:

cat = pd.Categorical(['a', 'b', 'c', 'b'], ordered=False)
ser = pd.Series(cat)
df = ser.to_frame()
>>> np.min(cat)   # <-- correctly raises
>>> np.min(ser)   # <-- correctly raises
>>> np.min(df)     # <-- incorrectly returns Series(['a'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions