Skip to content

DOC: sample codes should not override Python built-in functions #47606

Closed
@wany-oh

Description

@wany-oh

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

For example, https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#transformation

Alternatively, the built-in methods could be used to produce the same outputs.

max = ts.groupby(lambda x: x.year).transform("max")

min = ts.groupby(lambda x: x.year).transform("min")

max - min

Documentation problem

It is not good that the user guide lists codes that override Python built-in functions.

This is the only part I happened to find, but others may exist in doc. If so, its should be revised as well.

Suggested fix for documentation

In this case, max/min should rename like max_ts/min_ts.

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