Skip to content
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

ENH: rank na_options top and bottom #1508 #2159

Closed
wants to merge 1 commit into from

Conversation

@changhiskhan
Copy link
Contributor

commented Nov 2, 2012

@@ -115,7 +116,7 @@ def rank_1d_float64(object in_arr, ties_method='average', ascending=True):
sum_ranks += i + 1
dups += 1
val = sorted_data[i]
if val == nan_value:
if (val == nan_value) and (na_option == 'keep'):

This comment has been minimized.

Copy link
@wesm

wesm Nov 2, 2012

Member

This will dog performance pretty badly. i'll merge and then tweak this

This comment has been minimized.

Copy link
@wesm

wesm Nov 2, 2012

Member

actually it's pretty minor (only about a 10% penalty in a 1mm-length Series that's 50% NA)

@@ -86,7 +87,7 @@ def rank_1d_float64(object in_arr, ties_method='average', ascending=True):

values = np.asarray(in_arr).copy()

if ascending:
if ascending ^ (na_option == 'top'):

This comment has been minimized.

Copy link
@wesm

wesm Nov 2, 2012

Member

nice w/ the xor

wesm added a commit that referenced this pull request Nov 2, 2012
@wesm

This comment has been minimized.

Copy link
Member

commented Nov 2, 2012

OK we're good to go. Nice work

@wesm wesm closed this Nov 2, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.