Skip to content

Commit

Permalink
fix ts resample with base
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Jul 28, 2015
1 parent 572cf8e commit f593a22
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pandas/tseries/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _get_time_delta_bins(self, ax):
if not len(ax):
binner = labels = TimedeltaIndex(data=[], freq=self.freq, name=ax.name)
return binner, [], labels

labels = binner = TimedeltaIndex(start=ax[0],
end=ax[-1],
freq=self.freq,
Expand All @@ -238,11 +238,7 @@ def _get_time_delta_bins(self, ax):

# Addresses GH #10530
if self.base > 0:
last = labels[-1]
labels_shifted = labels.copy()
labels_shifted = labels_shifted.shift(self.base)
labels_shifted = labels_shifted[labels_shifted <= last]
labels = labels_shifted
labels = labels.shift(self.base)

bins = ax.searchsorted(end_stamps, side='left')

Expand Down

0 comments on commit f593a22

Please sign in to comment.