Skip to content

PERF: groupby-cummax,cummin #15048

Closed
Closed
@jreback

Description

@jreback

these could be implemented in cython, should be very straightforward as we already have much templated code

In [1]: np.random.seed(1234)

In [4]: G = 1000

In [5]: N = 10000

In [6]: df = pd.DataFrame({'A':np.random.randint(0,G,size=N),'B':np.random.randn(N)})

In [7]: %timeit df.groupby('A').cumsum()
1000 loops, best of 3: 1.27 ms per loop

In [8]: %timeit df.groupby('A').cummax()
1 loop, best of 3: 799 ms per loop

In [9]: %timeit df.groupby('A').cummin()
1 loop, best of 3: 796 ms per loop

In [10]: %timeit df.groupby('A').cumprod()
1000 loops, best of 3: 1.26 ms per loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    GroupbyPerformanceMemory or execution speed performance

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions