Skip to content

DOC: Outdated example of DataFrame.mean #61070

@rafael-patronilo

Description

@rafael-patronilo

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.mean.html#pandas.DataFrame.mean

Documentation problem

The second example specifies no axis and shows the mean for each column. According to the documentation above, the behavior when the axis is not specified should be to aggregate the mean over both axis since version 2.0.0

I didn't check if the same mistake is present in other aggregation functions.

Suggested fix for documentation

Replace df.mean() with df.mean(axis=0) on the example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions