-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
Milestone
Description
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 andreis