-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Test that using a tuple
or list
for parameter ascending
of sort_index
is the same
#43963
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
Conversation
…l to using a 'list'
df.set_index(["class", "animal"], inplace=True) | ||
|
||
sorted1 = df.sort_index(level=(0, 1), ascending=[True, False]) | ||
sorted2 = df.sort_index(level=(0, 1), ascending=(True, False)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define index directly without set_index and define expected explicitly. Also parametrize over list and tuple. Please call sorted1 or sorted2 result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phofl Thank you, please let me know if I addressed all the changes you requested in my last commit.
@@ -785,6 +785,48 @@ def test_sort_index_use_inf_as_na(self): | |||
result = expected.sort_index() | |||
tm.assert_frame_equal(result, expected) | |||
|
|||
@pytest.mark.parametrize( | |||
"ascending", | |||
[(True, False)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add another parameterization as a list also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @fAndreuzzi |
I could not find a suitable place to add a
whatsnew
entry, if there is one I will push another commit.