-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Closed
Labels
Dtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Milestone
Description
xref #4892 as I'm going through #20812 I am seeing tests which suggest that trying to call slice_locs with float arguments against an integer type Index should raise a TypeError:
pandas/pandas/tests/indexes/test_base.py
Line 1350 in c4da79b
| pytest.raises(TypeError, |
While these tests are currently passing, I believe the TypeError is getting raised from the call to pytest.raises (specifically a 'list' object is not callable for the third argument to pytest.raises) and not as a result of the actual index.slice_locs call.
>>> pd.__version__
'0.23.0.dev0+824.gc4da79b5b.dirty'
>>> index = pd.Index(np.array([0, 1, 2, 5, 6, 7, 9, 10], dtype=int))
>>> index.slice_locs(5.0, 10.0)
(3, 8)
>>> index.slice_locs(4.5, 10.5)
(3, 8)Metadata
Metadata
Assignees
Labels
Dtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves