Skip to content

Commit e203fcf

Browse files
committed
doc updates
1 parent 384026b commit e203fcf

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

doc/source/timeseries.rst

+6-4
Original file line numberDiff line numberDiff line change
@@ -1473,8 +1473,9 @@ Furthermore, you can also specify multiple aggregation functions for each column
14731473
r.agg({'A' : ['sum','std'], 'B' : ['mean','std'] })
14741474
14751475
1476-
If a ``DataFrame`` does not have a ``DatetimeIndex``, but instead you want
1477-
to resample based on column in the frame, it can passed to the ``on`` keyword.
1476+
If a ``DataFrame`` does not have a datetimelike index, but instead you want
1477+
to resample based on datetimelike column in the frame, it can passed to the
1478+
``on`` keyword.
14781479

14791480
.. ipython:: python
14801481
@@ -1487,8 +1488,9 @@ to resample based on column in the frame, it can passed to the ``on`` keyword.
14871488
df
14881489
df.resample('M', on='date').sum()
14891490
1490-
Similarly, if you instead want to resample by a level of ``MultiIndex``, its
1491-
name or location can be passed to the ``level`` keyword.
1491+
Similarly, if you instead want to resample by a datetimelike
1492+
level of ``MultiIndex``, its name or location can be passed to the
1493+
``level`` keyword.
14921494

14931495
.. ipython:: python
14941496

doc/source/whatsnew/v0.19.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ Other enhancements
377377

378378
pd.Timestamp(year=2012, month=1, day=1, hour=8, minute=30)
379379

380-
- the ``.resample()`` function now accepts a ``on=`` or ``level=`` parameter for resampling on a column or ``MultiIndex`` level (:issue:`13500`)
380+
- the ``.resample()`` function now accepts a ``on=`` or ``level=`` parameter for resampling on a datetimelike column or ``MultiIndex`` level (:issue:`13500`)
381381

382382
.. ipython:: python
383383

pandas/core/generic.py

+5
Original file line numberDiff line numberDiff line change
@@ -4064,10 +4064,15 @@ def resample(self, rule, how=None, axis=0, fill_method=None, closed=None,
40644064
on : string, optional
40654065
For a DataFrame, column to use instead of index for resampling.
40664066
Column must be datetime-like.
4067+
4068+
.. versionadded:: 0.19.0
4069+
40674070
level : string or int, optional
40684071
For a MultiIndex, level (name or number) to use for
40694072
resampling. Level must be datetime-like.
40704073
4074+
.. versionadded:: 0.19.0
4075+
40714076
To learn more about the offset strings, please see `this link
40724077
<http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases>`__.
40734078

pandas/core/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def _get_grouper(self, obj):
247247
sort=self.sort)
248248
return self.binner, self.grouper, self.obj
249249

250-
def _set_grouper(self, obj, sort=False, converter=None):
250+
def _set_grouper(self, obj, sort=False):
251251
"""
252252
given an object and the specifications, setup the internal grouper
253253
for this particular specification

pandas/tseries/resample.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,10 @@ def __init__(self, obj, groupby=None, axis=0, kind=None, **kwargs):
9090
if self.groupby is not None:
9191
# upsampling and PeriodIndex resampling do not work
9292
# if resampling on a column or mi level
93-
# this is state used to catch and raise an error
93+
# this state used to catch and raise an error
9494
self.from_selection = (self.groupby.key is not None or
9595
self.groupby.level is not None)
96-
obj = self._convert_obj(obj)
97-
self.groupby._set_grouper(obj, sort=True)
96+
self.groupby._set_grouper(self._convert_obj(obj), sort=True)
9897

9998
def __unicode__(self):
10099
""" provide a nice str repr of our rolling object """

0 commit comments

Comments
 (0)