Skip to content

BUG: groupby.<reduction>(numeric_only=) does not validate non-bool arguments #62778

@mroeschke

Description

@mroeschke
In [1]: import pandas as pd

In [2]: df = pd.DataFrame({"A": range(5), "B": range(5)})

In [3]: df.groupby(["A"]).mean(["B"])
     B
A     
0  0.0
1  1.0
2  2.0
3  3.0
4  4.0

["B"] is being passed to numeric_only which appears checked only to be truthy/falsy.

I would expect this to raise a ValueError

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions