-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: window/rolling.py #35982
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
CLN: window/rolling.py #35982
Conversation
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.
Nice! I just tried running ./test_fash.sh
with assert result.ndim == 1
upon function entry, and everything passed
pandas/core/window/rolling.py
Outdated
|
||
return type(obj)(result, index=index, columns=block.columns) | ||
return result | ||
return Series(result, obj.index, name=obj.name) |
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.
obj._constructor?
Thanks @mroeschke |
@@ -454,7 +444,7 @@ def _insert_on_column(self, result: "DataFrame", obj: "DataFrame"): | |||
# insert at the end | |||
result[name] = extra_col | |||
|
|||
def _center_window(self, result, window) -> np.ndarray: | |||
def _center_window(self, result: np.ndarray, window) -> np.ndarray: |
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.
ATM _prep_values prevents us from doing anything with EAs, but in principle is that something we'd like to support?
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.
In the future yes, but I think a major blocker/consideration is that today rolling agg functions only operate on float64 inputs, so that will need to be addressed in tandem.
* CLN: rolling.py * Use obj._constructor instead Co-authored-by: Matt Roeschke <[email protected]>
* CLN: rolling.py * Use obj._constructor instead Co-authored-by: Matt Roeschke <[email protected]>
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff