Skip to content

ERR: numeric_only in reduction operations should disallow passing non-bools #53098

@phofl

Description

@phofl

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

df = pd.DataFrame({"x": [1], "y": [4]})
df.sum(numeric_only=None)

Issue Description

In 2.0 we changed the default to False, so no need to allow anything else except True/False.

Expected Behavior

We should raise an error

cc @rhshadrach thoughts?

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions