Skip to content

ENH: allow groupby (and drop_duplicates) on columns containing unhashable types #41759

Closed
@ezerkar

Description

@ezerkar

Is your feature request related to a problem?

well sort of, currently one can not groupby on a column containing unhashable types (e.g dicts)

Describe the solution you'd like

an easy workaround is to groupby on that column as type str and then remap the strings back to their orig type,
wondering if we can provide this process built in so one can groupby on unhashable types if she desires to

Describe alternatives you've considered

add a try except to allow hash(str(x)) in case hash(x) is impossible, or convert the column to str and add it back later

# Your code here, if applicable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions