Skip to content

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

Merged
merged 4 commits into from
May 24, 2023
Merged

Conversation

DeaMariaLeon
Copy link
Member

Towards #37875

Index.drop, identical, insert

DOC: Fixing EX01 - Added examples (pandas-dev#53336)

* Examples

* Changed Index.copy

* Corrected Float32Dtype & Float64Dtype

Added is_, take, putmask, unique
@DeaMariaLeon DeaMariaLeon added this to the 2.1 milestone May 23, 2023
@DeaMariaLeon DeaMariaLeon requested a review from MarcoGorelli May 23, 2023 15:16
Comment on lines 805 to 813
>>> 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
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Examples
--------
>>> idx = pd.Index(['a', 'b', 'c'])
>>> idx.take([2])
Copy link
Member

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')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's green @MarcoGorelli

Merge remote-tracking branch 'upstream/main' into examples23May
@mroeschke mroeschke merged commit 901a70d into pandas-dev:main May 24, 2023
@mroeschke
Copy link
Member

Thanks @DeaMariaLeon

@DeaMariaLeon DeaMariaLeon deleted the examples23May branch May 24, 2023 16:50
topper-123 pushed a commit to topper-123/pandas that referenced this pull request May 27, 2023
* 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
topper-123 pushed a commit to topper-123/pandas that referenced this pull request Jun 5, 2023
* 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
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants