Skip to content

Improve np.histogram performance for uniform bins #6099

Closed
@astrofrog

Description

@astrofrog

For the use case where the number of bins is specified by an integer in np.histogram, the use of searchsorted etc. is very inefficient. It's possible to get at least a factor of 5x speedup by being smarter about this case just with Python + Numpy code, and I can get a factor of 30 speedup with Cython.

Would it be worth implementing a more efficient version of that special (yet common) case? If so, I'd be happy to turn this issue into a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions