-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: update the DataFrame.head() docstring #20206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3607,6 +3607,10 @@ def head(self, n=5): | |
""" | ||
Return the first n rows. | ||
|
||
This function returns rows for the object based on the underlying | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is object the right word? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be good to use 'returns the first n rows' instead of just 'returns rows'. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup will update. |
||
index. It is useful for quickly testing if your object has the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be good to put this in a separate paragraph: 'It is useful for quickly testing if your object has the right type of data in it.' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm I thought that would be a bit too long. |
||
right type of data in it. | ||
|
||
Parameters | ||
---------- | ||
n : int, default 5 | ||
|
@@ -3620,6 +3624,7 @@ def head(self, n=5): | |
See Also | ||
-------- | ||
pandas.DataFrame.tail | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to https://python-sprints.github.io/pandas/guide/pandas_docstring.html, the format should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the catch! |
||
Returns the last n rows. | ||
|
||
Examples | ||
-------- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backticks around
n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!