-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: update the pandas.IntervalIndex docstring #20188
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
Conversation
Hello @verakai! Thanks for submitting the PR.
|
@@ -142,20 +142,24 @@ class IntervalIndex(IntervalMixin, Index): | |||
|
|||
Parameters | |||
---------- | |||
data : array-like (1-dimensional) | |||
data : array-Like (1-dimensional) |
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.
array-like is correct
closed : {'left', 'right', 'both', 'neither'}, default 'right' | ||
Whether the intervals are closed on the left-side, right-side, both or | ||
neither. | ||
dtype : dtype or None, default 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.
numpy dtype, optional
closed : {'left', 'right', 'both', 'neither'}, default 'right' | ||
Whether the intervals are closed on the left-side, right-side, both or | ||
neither. | ||
dtype : dtype or None, default None | ||
If None, dtype will be inferred. | ||
copy : boolean, default False |
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.
boolean -> bool
dtype : dtype or None, default None | ||
If None, dtype will be inferred. | ||
copy : boolean, default False | ||
Copy the meta-data. |
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.
this refers to copying of the input data
cc @jschendel if you'd have a look |
Looks like these changes were also included in #20224, and there are a few related comments there. |
Array-like containing Interval objects from which to build the | ||
IntervalIndex | ||
IntervalIndex. | ||
closed : {'left', 'right', 'both', 'neither'}, default 'right' |
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.
Can you swap the order of 'left'
and 'right'
here (and on the line below), so the default value appears first. I think some of the other Interval
related PRs from the sprint did the same thing, and it'd be nice to make this consistent.
Closing in favor of #23157 |
Docstring assignated to the Buenos Aires, Argentina chapter.
Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):
scripts/validate_docstrings.py <your-function-or-method>
git diff upstream/master -u -- "*.py" | flake8 --diff
python doc/make.py --single <your-function-or-method>
Please include the output of the validation script below between the "```" ticks:
If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.