-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Moving Series.rank and DataFrame.rank to generic.py #11924
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 all commits
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 |
---|---|---|
|
@@ -875,6 +875,12 @@ def test_rank_na_option(self): | |
assert_almost_equal(ranks0.values, exp0) | ||
assert_almost_equal(ranks1.values, exp1) | ||
|
||
def test_rank_axis(self): | ||
# check if using axes' names gives the same result | ||
df = pd.DataFrame([[2, 1], [4, 3]]) | ||
assert_frame_equal(df.rank(axis=0), df.rank(axis='index')) | ||
assert_frame_equal(df.rank(axis=1), df.rank(axis='columns')) | ||
|
||
def test_sem(self): | ||
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. can you add onto the rank tests in 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. Done |
||
alt = lambda x: np.std(x, ddof=1) / np.sqrt(len(x)) | ||
self._check_stat_op('sem', alt) | ||
|
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.
I think that we should have the signature:
def rank(self, method='average', axis=0, numeric_only=None, na_option='keep', ascending=True, pct=False)
this will be more consistent with other methods.
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.
I've modified the signature