Skip to content

Commit 08fe7ac

Browse files
author
Jean-Mathieu Deschenes
committed
Fixes from comments of @gfyoung
* Fix Lint Error
1 parent 5ab186c commit 08fe7ac

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

doc/source/whatsnew/v0.21.0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Indexing
155155

156156
- When called with a null slice (e.g. ``df.iloc[:]``), the ``.iloc`` and ``.loc`` indexers return a shallow copy of the original object. Previously they returned the original object. (:issue:`13873`).
157157
- When called on an unsorted ``MultiIndex``, the ``loc`` indexer now will raise ``UnsortedIndexError`` only if proper slicing is used on non-sorted levels (:issue:`16734`).
158-
- Fixed ``TimedeltaIndex.get_loc`` ``for np.timedelta64`` data type(:issue:`16909`).
158+
- Fixed ``TimedeltaIndex.get_loc`` ``for np.timedelta64`` inputs (:issue:`16909`).
159159

160160
I/O
161161
^^^

pandas/core/indexes/timedeltas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
_ensure_int64)
1616
from pandas.core.dtypes.missing import isnull
1717
from pandas.core.dtypes.generic import ABCSeries
18-
from pandas.core.common import _maybe_box, _values_from_object, is_bool_indexer
18+
from pandas.core.common import _maybe_box, _values_from_object
1919

2020
from pandas.core.indexes.base import Index
2121
from pandas.core.indexes.numeric import Int64Index

pandas/tests/indexes/timedeltas/test_timedelta.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def test_get_loc(self):
6666
for method, loc in [('pad', 1), ('backfill', 2), ('nearest', 1)]:
6767
assert idx.get_loc('1 day 1 hour', method) == loc
6868

69+
# GH 16909
6970
assert idx.get_loc(idx[1].to_timedelta64()) == 1
7071

7172
def test_get_loc_nat(self):

0 commit comments

Comments
 (0)