Skip to content

Commit ac189a1

Browse files
committed
fix the non_na_idx
1 parent 80a038b commit ac189a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_libs/algos_rank_helper.pxi.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def rank_1d_{{dtype}}(object in_arr, ties_method='average', ascending=True,
153153

154154
if (i == n - 1 or
155155
are_diff(util.get_value_at(sorted_data, i + 1), val) or
156-
i == non_na_idx - 1):
156+
i == non_na_idx):
157157
if tiebreak == TIEBREAK_AVERAGE:
158158
for j in range(i - dups + 1, i + 1):
159159
ranks[argsorted[j]] = sum_ranks / dups
@@ -190,7 +190,7 @@ def rank_1d_{{dtype}}(object in_arr, ties_method='average', ascending=True,
190190
count += 1.0
191191

192192
if (i == n - 1 or sorted_data[i + 1] != val or
193-
i == non_na_idx - 1):
193+
i == non_na_idx):
194194
if tiebreak == TIEBREAK_AVERAGE:
195195
for j in range(i - dups + 1, i + 1):
196196
ranks[argsorted[j]] = sum_ranks / dups

0 commit comments

Comments
 (0)