pydata/pandas — pull request #8155 by behzadnouri (2014-09-01 14:37:59+00:00)
Title: BUG: map builtins min/max to numpy/cython versions

closes https://github.com/pydata/pandas/issues/7722
on master:

In [4]: np.random.seed(27182)

In [5]: n = 100000

In [6]: df = DataFrame(np.random.randint(1, n / 100, (n, 3)),
...: columns=['jim', 'joe', 'jolie'])

In [7]: %timeit df.groupby(['jim']).agg(max)
10 loops, best of 3: 102 ms per loop

In [8]: %timeit df.groupby(['jim', 'joe']).agg(max)
1 loops, best of 3: 2.42 s per loop

In [9]: df.groupby(['jim']).apply(max).head() # this is broken
Out[9]:
jim
1 jolie
2 jolie
3 jolie
4 jolie
5 jolie
dtype: object
on branch:

In [9]: %timeit df.groupby(['jim']).agg(max)
100 loops, best of 3: 11 ms per loop

In [10]: %timeit df.groupby(['jim', 'joe']).agg(max)
10 loops, best of 3: 53.6 ms per loop

In [11]: df.groupby(['jim']).apply(max).head()
Out[11]:
jim joe jolie
jim
1 1 999 989
2 2 997 986
3 3 981 973
4 4 989 992
5 5 995 977