File tree 1 file changed +3
-27
lines changed
1 file changed +3
-27
lines changed Original file line number Diff line number Diff line change @@ -1393,7 +1393,6 @@ def _get_time_bins(self, ax):
1393
1393
self .freq ,
1394
1394
closed = self .closed ,
1395
1395
base = self .base )
1396
- tz = ax .tz
1397
1396
# GH #12037
1398
1397
# use first/last directly instead of call replace() on them
1399
1398
# because replace() will swallow the nanosecond part
@@ -1402,29 +1401,11 @@ def _get_time_bins(self, ax):
1402
1401
binner = labels = date_range (freq = self .freq ,
1403
1402
start = first ,
1404
1403
end = last ,
1405
- tz = tz ,
1404
+ tz = ax . tz ,
1406
1405
name = ax .name ,
1407
1406
ambiguous = 'infer' ,
1408
1407
nonexistent = 'shift' )
1409
1408
1410
- # GH 15549
1411
- # In edge case of tz-aware resapmling binner last index can be
1412
- # less than the last variable in data object, this happens because of
1413
- # DST time change
1414
- if len (binner ) > 1 and binner [- 1 ] < last :
1415
- extra_date_range = pd .date_range (binner [- 1 ], last + self .freq ,
1416
- freq = self .freq , tz = tz ,
1417
- name = ax .name )
1418
- binner = labels = binner .append (extra_date_range [1 :])
1419
-
1420
- # a little hack
1421
- trimmed = False
1422
- if (len (binner ) > 2 and binner [- 2 ] == last and
1423
- self .closed == 'right' ):
1424
-
1425
- binner = binner [:- 1 ]
1426
- trimmed = True
1427
-
1428
1409
ax_values = ax .asi8
1429
1410
binner , bin_edges = self ._adjust_bin_edges (binner , ax_values )
1430
1411
@@ -1436,13 +1417,8 @@ def _get_time_bins(self, ax):
1436
1417
labels = binner
1437
1418
if self .label == 'right' :
1438
1419
labels = labels [1 :]
1439
- elif not trimmed :
1440
- labels = labels [:- 1 ]
1441
- else :
1442
- if self .label == 'right' :
1443
- labels = labels [1 :]
1444
- elif not trimmed :
1445
- labels = labels [:- 1 ]
1420
+ elif self .label == 'right' :
1421
+ labels = labels [1 :]
1446
1422
1447
1423
if ax .hasnans :
1448
1424
binner = binner .insert (0 , NaT )
You can’t perform that action at this time.
0 commit comments