-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Make sure correct values are passed to Rolling._on when axis=1 #28267
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
BUG: Make sure correct values are passed to Rolling._on when axis=1 #28267
Conversation
pandas/core/window/rolling.py
Outdated
if self.axis == 0: | ||
return self.obj.index | ||
elif self.axis == 1: | ||
return self.obj.transpose().index |
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 think we can just call self.obj.columns
instead of having to transpose.
lgtm. @mroeschke think we need more testing for this? |
pandas/tests/window/test_rolling.py
Outdated
@@ -334,3 +334,26 @@ def test_readonly_array(self): | |||
result = pd.Series(arr).rolling(2).mean() | |||
expected = pd.Series([np.nan, 2, np.nan, np.nan, 4]) | |||
tm.assert_series_equal(result, expected) | |||
|
|||
def test_rolling_datetime(self, axis_frame): |
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.
One last thing: Could you parameterize over the tz_naive_fixture
?
Hello @MarcoGorelli! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-09-04 16:32:05 UTC |
Thanks @MarcoGorelli! |
…andas-dev#28267) * Make sure correct values are passed to Rolling._on when axis=1 * Update rolling.py * Capitalise 'd' as in documentation * Parametrize over tz_naive_fixture * autoformat
…andas-dev#28267) * Make sure correct values are passed to Rolling._on when axis=1 * Update rolling.py * Capitalise 'd' as in documentation * Parametrize over tz_naive_fixture * autoformat
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff