-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: DataFrameGroupBy.quantile raises for non-numeric dtypes rather than dropping columns #34756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,3 +232,11 @@ def test_groupby_quantile_nullable_array(values, q): | |
|
||
expected = pd.Series(true_quantiles * 2, index=idx, name="b") | ||
tm.assert_series_equal(result, expected) | ||
|
||
|
||
@pytest.mark.parametrize("q", [0.5, [0.0, 0.5, 1.0]]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you also try with an empty frame that has the same dtypes, that should raise? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not raise on an empty frame, but instead returns an empty frame with the columns that are valid dtypes, in the case of the test |
||
def test_groupby_quantile_skips_invalid_dtype(q): | ||
df = pd.DataFrame({"a": [1], "b": [2.0], "c": ["x"]}) | ||
result = df.groupby("a").quantile(q) | ||
expected = df.groupby("a")[["b"]].quantile(q) | ||
tm.assert_frame_equal(result, expected) |
Uh oh!
There was an error while loading. Please reload this page.