-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
DataFrame.rolling documentation of method='table' #40519
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
| Hello @joshlk! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-04-14 11:10:21 UTC |
mzeitlin11 left a comment
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.
Thanks for the pr, @joshlk! A couple quick suggestions
Co-authored-by: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com>
Co-authored-by: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com>
…c/rolling.apply.table
pandas/core/window/rolling.py Outdated
| 2013-01-01 09:00:05 NaN | ||
| 2013-01-01 09:00:06 4.0 | ||
| Rolling window apply function that uses multiple columns as input using |
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.
This might be better in the rolling apply docstring (as many of these parameters are specific to apply)
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.
The doc example is primarily about how to use the method='table' feature in the rolling function. Also the apply doc currently doesn't include any examples - all the examples seem to be in the rolling doc (e.g. .sum(std=3))
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.
Right but this particular usage of method='table' feature in the rolling function is only specific to rolling(...).apply(...).
The apply doc could definitely use more examples!
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.
Would you like me to move this to the apply docstring?
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.
Yes, this example you made would go great in the rolling apply docstring
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.
@mroeschke Hi, I've tried adding the docs to the apply doc-string but I'm unsure how to do it - my latest commit isn't working. Sorry I am unfamiliar with how the doc-string is being generated.
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.
You can see in this CI check what modifications need to be made to get this check to pass: https://github.com/pandas-dev/pandas/pull/40519/checks?check_run_id=2342425934
Additionally you can see here how to render the docs locally to see if there's inconsistent formatting somewhere: https://pandas.pydata.org/pandas-docs/dev/development/contributing_documentation.html#building-the-documentation
| @joshlk ci is failing can you fix-up |
Hi, I've tried adding the docs to the apply doc-string but I'm unsure how to do it - my latest commit isn't working. Sorry I am unfamiliar with how the doc-string is being generated. Could you please help |
| you can run the docstring validation script locally. (if on windows use git bash or wsl) to build the docs, see https://pandas.pydata.org/pandas-docs/dev/development/contributing_documentation.html#building-the-documentation this PR is also failing pre-commit checks (black and trailing whitespace) see https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit |
| @joshlk can you have a look at the points of the previous comment, and try to leave the CI green please? |
| method='table'. The apply function multiplies A with B and sums all rows | ||
| (dot product). | ||
| >>> df = pd.DataFrame({{'A': range(5), 'B': range(5,0,-1)}}) |
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 get a TypeError: unhashable type: 'dict' when I run this line. When I replace {{ with { and }} with } it works, though.
| Thanks for the PR, but appears that progress has stalled. Closing, but let us know if you're still interested in working on this and we'd be happy to reopen. |
Uh oh!
There was an error while loading. Please reload this page.