We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a05601 commit d171c87Copy full SHA for d171c87
pandas/tests/indexes/datetimes/test_indexing.py
@@ -423,6 +423,17 @@ def test_get_loc(self):
423
with pytest.raises(NotImplementedError):
424
idx.get_loc(time(12, 30), method="pad")
425
426
+ def test_get_loc_tz_aware(self):
427
+ # https://github.com/pandas-dev/pandas/issues/32140
428
+ dti = pd.date_range(
429
+ pd.Timestamp("2019-12-12 00:00:00", tz="US/Eastern"),
430
+ pd.Timestamp("2019-12-13 00:00:00", tz="US/Eastern"),
431
+ freq="5s",
432
+ )
433
+ key = pd.Timestamp("2019-12-12 10:19:25", tz="US/Eastern")
434
+ result = dti.get_loc(key, method="nearest")
435
+ assert result == 7433
436
+
437
def test_get_loc_nat(self):
438
# GH#20464
439
index = DatetimeIndex(["1/3/2000", "NaT"])
0 commit comments