-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: tweak paragraph regarding cut and IntervalIndex #27132
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
doc/source/user_guide/advanced.rst
Outdated
|
||
.. ipython:: python | ||
|
||
c = pd.cut(range(4), bins=2) | ||
c | ||
c.categories | ||
|
||
Furthermore, ``IntervalIndex`` allows one to bin *other* data with these same | ||
bins, with ``NaN`` representing a missing value similar to other dtypes. | ||
:func:`cut` also accepts an ``IntervalIndex`` for its `bins` argument, which enables |
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.
Double backticks for anything that is not a role 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.
fixed.
doc/source/user_guide/advanced.rst
Outdated
|
||
.. ipython:: python | ||
|
||
pd.cut([0, 3, 5, 1], bins=c.categories) | ||
|
||
When :func:`cut` is passed an ``IntervalIndex`` for the `bins` argument, The ``Interval`` | ||
values in the ``IntervalIndex`` define the bins and any value which falls outside all | ||
bins will be assigned a ``NaN`` value. |
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.
I would keep it to the last part here (the former is already explained before the example), like "Values that fall outside the passed Intervals will be assigned a NaN
value".
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.
You're right. Updated.
@pilkibun Thanks! |
I thought this paragraph could be improved, so I tried to.