We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b16e2e commit 1940cfdCopy full SHA for 1940cfd
pandas/core/resample.py
@@ -1413,6 +1413,16 @@ def _get_time_bins(self, ax):
1413
ambiguous='infer',
1414
nonexistent='shift_forward')
1415
1416
+ # GH #24972
1417
+ # In edge case of tz-aware grouping binner last index can be
1418
+ # less than the ax.max() variable in data object, this happens
1419
+ # because of normalization
1420
+ if len(binner) > 1 and binner[-1] < ax.max():
1421
+ extra_date_range = pd.date_range(binner[-1], ax.max() + self.freq,
1422
+ freq=self.freq, tz=binner[-1].tz,
1423
+ name=ax.name)
1424
+ binner = labels = binner.append(extra_date_range[1:])
1425
+
1426
ax_values = ax.asi8
1427
binner, bin_edges = self._adjust_bin_edges(binner, ax_values)
1428
0 commit comments