A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/15048 below:

groupby-cummax,cummin · Issue #15048 · pandas-dev/pandas · GitHub

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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4