Skip to content

Commit

Permalink
BUG: Explicit quantile to 0.5. Fix format pandas-dev#33200
Browse files Browse the repository at this point in the history
  • Loading branch information
mabelvj committed Apr 28, 2020
1 parent 662c102 commit e70e3ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pandas/_libs/groupby.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ def group_quantile(ndarray[float64_t] out,
if labels.any():
# Put '-1' (NaN) labels as the last group so it does not interfere
# with the calculations.
labels[labels==-1] = np.max(labels) + 1
labels[labels == -1] = np.max(labels) + 1
# Get an index of values sorted by labels and then values
order = (values, labels)
sort_arr = np.lexsort(order).astype(np.int64, copy=False)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/groupby/test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ def test_quantile_missing_group_values_correct_results(
# GH 28662, GH 33200
df = pd.DataFrame({"key": key, "val": val})

result = df.groupby("key").quantile()
result = df.groupby("key").quantile(0.5)
expected = pd.DataFrame(
expected_val, index=pd.Index(expected_key, name="key"), columns=["val"]
)
Expand Down

0 comments on commit e70e3ca

Please sign in to comment.