Skip to content

nunique is slower than len(set(x.dropna())) for smaller Series. #7771

Closed
@lexual

Description

@lexual

This is biting me when applying nunique on some groupby operations.

In one benchmark, which I'll shortly share, nunique() is slower until we get to a length of 3000.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dtype ConversionsUnexpected or buggy dtype conversionsNumeric OperationsArithmetic, Comparison, and Logical operationsPerformanceMemory or execution speed performanceRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions