-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
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.
remove double newline
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.
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.
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Can you have a look at the CI errors please? |
Co-authored-by: s1099 <[email protected]>
Co-authored-by: s1099 <[email protected]>
The checks are still failing, could you please fix them? |
Hi @datapythonista I believe we have fixed all the CI errors. Could you please re-review? |
/preview |
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/57867/ |
Thanks @sjalkote |
* 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]>
Picked up issue #49202. This adds examples for creating index, dataframe, and series accessors.