Skip to content

DOC: EX01 ({Categorical, Interval, Multi, Datetime, Timedelta}-Index) #53925

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 14 commits into from
Jun 30, 2023

Conversation

Charlie-XIAO
Copy link
Contributor

Also removing some items from ci/code_checks.sh that have already had examples on the main branch.

@Charlie-XIAO Charlie-XIAO requested a review from mroeschke as a code owner June 29, 2023 09:31
@DeaMariaLeon
Copy link
Member

Thank you for your PR @Charlie-XIAO!

Some of items that you removed from the file ci/code_checks.sh thinking that they already have examples, should not be removed. Many methods share one (the same) docstring and it looks like that.

For example pandas.CategoricalIndex.codes seems on the dev website as it had an example already. But the example is actually for pandas.Categorical.codes.

I only checked a couple of methods that were removed. It would be great if you could double check the rest please. Thanks a lot, your help is very much appreciated. :-)

@DeaMariaLeon DeaMariaLeon added this to the 2.1 milestone Jun 29, 2023
@Charlie-XIAO
Copy link
Contributor Author

Charlie-XIAO commented Jun 29, 2023

@DeaMariaLeon Thanks for the reminder! I see what you mean, so those examples should be modified. Maybe I can just do them in this PR as well. I also need to run scripts/validate_docstrings.py since there is a decent number of errors.

@Charlie-XIAO Charlie-XIAO changed the title DOC: EX01 ({Categorical, Interval, Multi, Datetime, Timedelta}Index) DOC: EX01 ({Categorical, Interval, Multi, Datetime, Timedelta}-Index) Jun 29, 2023
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

nice, thanks for your work here! and thanks Dea for reviewing

Comment on lines +763 to -764
For :class:`pandas.Series`:

For Series:
Copy link
Member

Choose a reason for hiding this comment

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

nice!

Comment on lines +286 to +287
Examples
--------
Copy link
Member

Choose a reason for hiding this comment

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

great example here!

Comment on lines -770 to +769
>>> raw_cat = pd.Categorical(["a", "b", "c", "a"], categories=["b", "c", "d"],)
>>> raw_cat = pd.Categorical(['a', 'b', 'c', 'a'], categories=['b', 'c', 'd'])
Copy link
Member

Choose a reason for hiding this comment

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

just for the future - in general, let's not bother with stylistic changes like changing double quotes to single quotes, at least until we have an automated tool to enforce this on docstrings

@MarcoGorelli MarcoGorelli merged commit 2574694 into pandas-dev:main Jun 30, 2023
@Charlie-XIAO Charlie-XIAO deleted the doc-ex01-2 branch June 30, 2023 09:36
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
…pandas-dev#53925)

* add examples for CategoricalIndex.equals

* add examples for MultiIndex.dtypes

* add examples for MultiIndex.drop

* add examples for DatetimeIndex.to_pydatetime/std

* add examples for TimedeltaIndex

* minor modifications

* fix docstrings and make up for removed ones

* fix doctests
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