-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Fixing EX01 - Added examples #53352
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
Index.drop, identical, insert DOC: Fixing EX01 - Added examples (pandas-dev#53336) * Examples * Changed Index.copy * Corrected Float32Dtype & Float64Dtype Added is_, take, putmask, unique
pandas/core/indexes/base.py
Outdated
>>> idx1 = pd.Index(['1', '2', '3']) | ||
>>> idx2 = pd.Index(['1', '2', '3']) | ||
>>> idx2.is_(idx1) | ||
False | ||
|
||
>>> idx1 = pd.Index(['1', '2', '3']) | ||
>>> new_name = idx1 | ||
>>> new_name.is_(idx1) | ||
True |
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.
to make it clearer, maybe we could have an example like
>>> idx1.is_(idx1.view())
True
>>> idx1.is_(idx1.copy())
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.
Done
pandas/core/indexes/base.py
Outdated
Examples | ||
-------- | ||
>>> idx = pd.Index(['a', 'b', 'c']) | ||
>>> idx.take([2]) |
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 think take
is often used with more than one element, and there can be repetitions - maybe something like
In [10]: idx = pd.Index(['a', 'b', 'c'])
In [11]: idx.take([2, 2, 1, 2])
Out[11]: Index(['c', 'c', 'b', 'c'], dtype='object')
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.
Done
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.
It's green @MarcoGorelli
Thanks @DeaMariaLeon |
* DOC Added Index examples Index.drop, identical, insert DOC: Fixing EX01 - Added examples (pandas-dev#53336) * Examples * Changed Index.copy * Corrected Float32Dtype & Float64Dtype Added is_, take, putmask, unique * Modified Index.is_ and take examples
* DOC Added Index examples Index.drop, identical, insert DOC: Fixing EX01 - Added examples (pandas-dev#53336) * Examples * Changed Index.copy * Corrected Float32Dtype & Float64Dtype Added is_, take, putmask, unique * Modified Index.is_ and take examples
* DOC Added Index examples Index.drop, identical, insert DOC: Fixing EX01 - Added examples (pandas-dev#53336) * Examples * Changed Index.copy * Corrected Float32Dtype & Float64Dtype Added is_, take, putmask, unique * Modified Index.is_ and take examples
Towards #37875