Skip to content

Commit 2175657

Browse files
committed
BUG: Fix quantile calculation. Revert changes after merging master. #33200
1 parent 662c102 commit 2175657

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pandas/_libs/groupby.pyx

+2-5
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,8 @@ def group_quantile(ndarray[float64_t] out,
777777
counts[lab] += 1
778778
if not mask[i]:
779779
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
780+
# Put '-1' (NaN) labels as the last group so it does not interfere with the calculations.
781+
labels[labels==-1] = np.max(labels) + 1
785782
# Get an index of values sorted by labels and then values
786783
order = (values, labels)
787784
sort_arr = np.lexsort(order).astype(np.int64, copy=False)

0 commit comments

Comments
 (0)