Skip to content

Commit e70e3ca

Browse files
committed
BUG: Explicit quantile to 0.5. Fix format #33200
1 parent 662c102 commit e70e3ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/_libs/groupby.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ def group_quantile(ndarray[float64_t] out,
781781
if labels.any():
782782
# Put '-1' (NaN) labels as the last group so it does not interfere
783783
# with the calculations.
784-
labels[labels==-1] = np.max(labels) + 1
784+
labels[labels == -1] = np.max(labels) + 1
785785
# Get an index of values sorted by labels and then values
786786
order = (values, labels)
787787
sort_arr = np.lexsort(order).astype(np.int64, copy=False)

pandas/tests/groupby/test_function.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ def test_quantile_missing_group_values_correct_results(
15001500
# GH 28662, GH 33200
15011501
df = pd.DataFrame({"key": key, "val": val})
15021502

1503-
result = df.groupby("key").quantile()
1503+
result = df.groupby("key").quantile(0.5)
15041504
expected = pd.DataFrame(
15051505
expected_val, index=pd.Index(expected_key, name="key"), columns=["val"]
15061506
)

0 commit comments

Comments
 (0)