Skip to content

BUG: Use float64 for row counter in rank() #18274

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.21.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Reshaping
Numeric
^^^^^^^

-
- Fixed incorrect maximum :func:`Series.rank` percentile for large arrays (:issue:`18271`)
-
-

Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/algos_rank_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def rank_1d_{{dtype}}(object in_arr, ties_method='average', ascending=True,
float64_t sum_ranks = 0
int tiebreak = 0
bint keep_na = 0
float count = 0.0
float64_t count = 0.0
tiebreak = tiebreakers[ties_method]

{{if dtype == 'float64'}}
Expand Down Expand Up @@ -234,7 +234,7 @@ def rank_2d_{{dtype}}(object in_arr, axis=0, ties_method='average',
float64_t sum_ranks = 0
int tiebreak = 0
bint keep_na = 0
float count = 0.0
float64_t count = 0.0

tiebreak = tiebreakers[ties_method]

Expand Down