Skip to content

DOC: Negative values ​​of n in pandas.DataFrame.head #60083

@jmonti-gh

Description

@jmonti-gh

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/reference/api/pandas.DataFrame.head.html

Documentation problem

When you explain negative values ​​of n you indicate an incorrect equivalence of the indexing of the DataFrame.
It says: "For negative values of n, this function returns all rows except the last |n| rows, equivalent to df[:n]."

Suggested fix for documentation

And it should say:
"..., equivalent to df[:-n]."

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