Skip to content

Commit 1834bbb

Browse files
committed
bug in Resampling to frequency='B' closed='right' nd label='right'
1 parent 224c6ff commit 1834bbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/resample.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,11 @@ def _get_time_bins(self, ax: DatetimeIndex):
21732173
if self.closed == "right":
21742174
labels = binner
21752175
if self.label == "right":
2176-
labels = labels[1:]
2176+
if binner.freqstr == "B":
2177+
labels = labels[1:-1]
2178+
bins = bins[0:-1]
2179+
else:
2180+
labels = labels[1:]
21772181
elif self.label == "right":
21782182
labels = labels[1:]
21792183

0 commit comments

Comments
 (0)