Skip to content

Commit b8b10b0

Browse files
author
Nicholas Ver Halen
committed
Added the on arg to resample on a grouped dataframe.
1 parent 34cdfa4 commit b8b10b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/groupby.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1140,13 +1140,13 @@ def ohlc(self):
11401140

11411141
@Substitution(name='groupby')
11421142
@Appender(_doc_template)
1143-
def resample(self, rule, *args, **kwargs):
1143+
def resample(self, rule, on=None, *args, **kwargs):
11441144
"""
11451145
Provide resampling when using a TimeGrouper
11461146
Return a new grouper with our resampler appended
11471147
"""
11481148
from pandas.tseries.resample import get_resampler_for_grouping
1149-
return get_resampler_for_grouping(self, rule, *args, **kwargs)
1149+
return get_resampler_for_grouping(self, rule, key=on, *args, **kwargs)
11501150

11511151
@Substitution(name='groupby')
11521152
@Appender(_doc_template)

0 commit comments

Comments
 (0)