We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 662c102 commit 2175657Copy full SHA for 2175657
pandas/_libs/groupby.pyx
@@ -777,11 +777,8 @@ def group_quantile(ndarray[float64_t] out,
777
counts[lab] += 1
778
if not mask[i]:
779
non_na_counts[lab] += 1
780
-
781
- if labels.any():
782
- # Put '-1' (NaN) labels as the last group so it does not interfere
783
- # with the calculations.
784
- labels[labels==-1] = np.max(labels) + 1
+ # Put '-1' (NaN) labels as the last group so it does not interfere with the calculations.
+ labels[labels==-1] = np.max(labels) + 1
785
# Get an index of values sorted by labels and then values
786
order = (values, labels)
787
sort_arr = np.lexsort(order).astype(np.int64, copy=False)
0 commit comments