Skip to content

Commit 9a6a4b9

Browse files
committed
fix rank issue when asec is false
1 parent 7c14e4f commit 9a6a4b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/_libs/algos_rank_helper.pxi.in

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

136136
sorted_data = values.take(_as)
137137
sorted_mask = mask.take(_as)
138-
_indices = order[1].take(_as).nonzero()[0]
138+
_indices = np.diff(sorted_mask).nonzero()[0]
139139
non_na_idx = _indices[0] if len(_indices) > 0 else -1
140140
argsorted = _as.astype('i8')
141141

0 commit comments

Comments
 (0)