-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Fix PR06 errors in Series docstrings (#28253) #28288
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
DOC: Fix PR06 errors in Series docstrings (#28253) #28288
Conversation
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.
minor stylistic things but this looks pretty good. This doesn't close anything directly right? Just progress towards it?
pandas/core/generic.py
Outdated
@@ -4621,8 +4621,9 @@ def filter(self, items=None, like=None, regex=None, axis=None): | |||
Keep labels from axis for which "like in label == True". | |||
regex : str (regular expression) | |||
Keep labels from axis for which re.search(regex, label) == True. | |||
axis : int or string axis name | |||
The axis to filter on. By default this is the info axis, | |||
axis : int or str |
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.
There is a particular convention for axis you can use
axis : {0 or ‘index’, 1 or ‘columns’, None}, default None
From the docs:
https://pandas.pydata.org/pandas-docs/stable/development/contributing_docstring.html#parameter-types
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.
Updated in a99ef99
pandas/core/generic.py
Outdated
@@ -2533,7 +2533,7 @@ def to_msgpack(self, path_or_buf=None, encoding="utf-8", **kwargs): | |||
|
|||
Parameters | |||
---------- | |||
path : string File path, buffer-like, or None | |||
path : str (file path), buffer-like, or None |
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.
path : str (file path), buffer-like, or None | |
path : str, filepath, buffer-like, or None |
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.
Since neither 'file path' nor 'filepath' are listed as types here, I've removed this and added a little clarification below.
pandas/core/generic.py
Outdated
@@ -4855,7 +4856,7 @@ def sample( | |||
random_state : int or numpy.random.RandomState, optional | |||
Seed for the random number generator (if int), or numpy RandomState | |||
object. | |||
axis : int or string, optional | |||
axis : int or str, optional |
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.
same thing here for axis
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.
Updated in a99ef99
pandas/core/generic.py
Outdated
freq : DateOffset, timedelta, or str, default None | ||
Increment to use from the tseries module | ||
or time rule expressed as a string (e.g. 'EOM') | ||
axis : int or str |
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.
and finally here
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.
Updated in a99ef99
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.
minor stylistic things but this looks pretty good. This doesn't close anything directly right? Just progress towards it?
Thanks -- doesn't close anything, just covers the first task in issue 28253
Great thanks @danielplawrence ! |
First bit of work on #28253, fixes PR06 validation errors in Series docstrings.
Mostly just converting boolean -> bool, string -> str, integer -> ; re-worded a little where necessary.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Ran validate_docstrings.py and confirmed all PR06 issues for Series are removed, and that no additional validation errors are added by this change.