Skip to content

DOC: Add examples for creating an index accessor #57867

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 25 commits into from
Apr 3, 2024

Conversation

sjalkote
Copy link
Contributor

@sjalkote sjalkote commented Mar 16, 2024

Picked up issue #49202. This adds examples for creating index, dataframe, and series accessors.

@sjalkote
Copy link
Contributor Author

pre-commit.ci autofix

@sjalkote
Copy link
Contributor Author

pre-commit.ci autofix

Copy link
Contributor

@s1099 s1099 left a comment

Choose a reason for hiding this comment

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

remove double newline

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Appender is something that we used before doc existed, but I think it'd be better to not use, as makes things more difficult to understand. I think you're adding the examples to all register accessor functions, so you can add the Examples header to the main docstring, and then add a variable for the content of the section as it's done with {klass}.

Unrelated, in the examples section is not needed to create a code-block. You can just start the code with >>> and the docstring parser should understand it's code. Also, it's not needed to import pandas, pd should already be available without importing.

@sjalkote
Copy link
Contributor Author

pre-commit.ci autofix

@sjalkote sjalkote requested a review from datapythonista March 17, 2024 22:05
@datapythonista
Copy link
Member

Can you have a look at the CI errors please?

@Aloqeely
Copy link
Member

The checks are still failing, could you please fix them?

@sjalkote sjalkote requested a review from mroeschke as a code owner April 1, 2024 22:49
@sjalkote
Copy link
Contributor Author

sjalkote commented Apr 2, 2024

Hi @datapythonista I believe we have fixed all the CI errors. Could you please re-review?

@sjalkote sjalkote requested a review from mroeschke April 3, 2024 00:04
@mroeschke
Copy link
Member

/preview

Copy link
Contributor

github-actions bot commented Apr 3, 2024

Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/57867/

@mroeschke mroeschke added this to the 3.0 milestone Apr 3, 2024
@mroeschke mroeschke merged commit 308b773 into pandas-dev:main Apr 3, 2024
46 checks passed
@mroeschke
Copy link
Member

Thanks @sjalkote

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* DOC: Add examples for creating an index accessor

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix E501 lint errors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix failing CI builds for Docstring

* fix newline

* Remove redundant code-block directives

* Use variables for `Examples` content

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix docstring validation errors

Co-authored-by: s1099 <[email protected]>

* Fix docstring validation errors

Co-authored-by: s1099 <[email protected]>

* Fix CI errors

* Fix CI errors

* Fix CI errors

* Fix CI errors

* Fix CI errors (again lol)

* Undo validation ignore for docstrings

---------

Co-authored-by: TechnoShip123 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: s1099 <[email protected]>
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.

DOC: Improve the register_index_accessor Documentation
5 participants