-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Fix RangeIndex.get_indexer for decreasing RangeIndex #28680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
f9df106
88297dd
6c15e97
4afb48d
ae482a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -424,6 +424,14 @@ def test_get_indexer_limit(self): | |
expected = np.array([0, 1, 2, 3, 3, -1], dtype=np.intp) | ||
tm.assert_numpy_array_equal(result, expected) | ||
|
||
@pytest.mark.parametrize("stop", [0, -1, -2]) | ||
def test_get_indexer_decreasing(self, stop): | ||
# GH 28678 | ||
index = RangeIndex(7, stop, -3) | ||
result = index.get_indexer(range(9)) | ||
expected = np.array([-1, 2, -1, -1, 1, -1, -1, 0, -1], dtype=np.intp) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason to have to specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
tm.assert_numpy_array_equal(result, expected) | ||
|
||
def test_join_outer(self): | ||
# join with Int64Index | ||
other = Int64Index(np.arange(25, 14, -1)) | ||
|
Uh oh!
There was an error while loading. Please reload this page.