Skip to content

Commit bd8f31a

Browse files
committed
update comments for _adjust_binner_for_upsample
1 parent ba17169 commit bd8f31a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pandas/core/resample.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,10 @@ def _downsample(self, how, **kwargs):
963963
return self._wrap_result(result)
964964

965965
def _adjust_binner_for_upsample(self, binner):
966-
""" adjust our binner when upsampling """
966+
"""
967+
Adjust our binner when upsampling.
968+
The range of a new index should not be outside specified range
969+
"""
967970
if self.closed == 'right':
968971
binner = binner[1:]
969972
else:
@@ -1156,7 +1159,11 @@ def _get_binner_for_time(self):
11561159
return self.groupby._get_time_delta_bins(self.ax)
11571160

11581161
def _adjust_binner_for_upsample(self, binner):
1159-
""" adjust our binner when upsampling """
1162+
"""
1163+
Adjust our binner when upsampling.
1164+
The range of a new index is allowed to be greater than original range
1165+
so we don't need to change the length of a binner, GH 13022
1166+
"""
11601167
return binner
11611168

11621169

pandas/tests/test_resample.py

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from pandas.compat import range, lrange, zip, OrderedDict
2727
from pandas.errors import UnsupportedFunctionCall
2828
import pandas.tseries.offsets as offsets
29-
from pandas.tseries.frequencies import to_offset
3029
from pandas.tseries.offsets import Minute, BDay
3130

3231
from pandas.core.groupby.groupby import DataError

0 commit comments

Comments
 (0)