Skip to content

DOC: pandas.DataFrame.aggregate return value #60645

@sa42bme

Description

@sa42bme

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.aggregate.html#pandas.DataFrame.aggregate

Documentation problem

The documentation of pandas.DataFrame.aggregate() method says:

The return can be:

* scalar : when Series.agg is called with single function
* Series : when DataFrame.agg is called with a single function
* DataFrame : when DataFrame.agg is called with several functions

But
df = pd.DataFrame([[1]]) ; type(df.agg(lambda x: 3*x))
returns pandas.core.frame.DataFrame even though .agg() was called with a single function

Suggested fix for documentation

I'd love to offer a fix, but the reason I was looking up the docs was that I'd like to know what .agg() does exactly...

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