diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index fb9b5e7831c88..1d3d4717c6bdb 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -2994,7 +2994,9 @@ def _reorder_by_uniques(uniques, labels): np.prod: 'prod', np.std: 'std', np.var: 'var', - np.median: 'median' + np.median: 'median', + np.max: 'max', + np.min: 'min' } diff --git a/vb_suite/timeseries.py b/vb_suite/timeseries.py index 0850499f42480..c43d2fb76dbdb 100644 --- a/vb_suite/timeseries.py +++ b/vb_suite/timeseries.py @@ -243,3 +243,29 @@ def date_range(start=None, end=None, periods=None, freq=None): setup, start_date=datetime(2013, 9, 30)) +#---------------------------------------------------------------------- +# Resampling: fast-path various functions + +setup = common_setup + """ +rng = date_range('20130101',periods=100000,freq='50L') +df = DataFrame(np.random.randn(100000,2),index=rng) +""" + +dataframe_resample_mean_string = \ + Benchmark("df.resample('1s', how='mean')", setup) + +dataframe_resample_mean_numpy = \ + Benchmark("df.resample('1s', how=np.mean)", setup) + +dataframe_resample_min_string = \ + Benchmark("df.resample('1s', how='min')", setup) + +dataframe_resample_min_numpy = \ + Benchmark("df.resample('1s', how=np.min)", setup) + +dataframe_resample_max_string = \ + Benchmark("df.resample('1s', how='max')", setup) + +dataframe_resample_max_numpy = \ + Benchmark("df.resample('1s', how=np.max)", setup) +