Skip to content

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

Merged
merged 2 commits into from
Aug 31, 2020
Merged

CLN: window/rolling.py #35982

merged 2 commits into from
Aug 31, 2020

Conversation

mroeschke
Copy link
Member

  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

@mroeschke mroeschke added Clean Window rolling, ewma, expanding labels Aug 30, 2020
@mroeschke mroeschke added this to the 1.2 milestone Aug 30, 2020
@MarcoGorelli MarcoGorelli self-requested a review August 30, 2020 08:54
Copy link
Member

@MarcoGorelli MarcoGorelli left a 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


return type(obj)(result, index=index, columns=block.columns)
return result
return Series(result, obj.index, name=obj.name)
Copy link
Member

Choose a reason for hiding this comment

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

obj._constructor?

@jbrockmendel jbrockmendel merged commit 945a543 into pandas-dev:master Aug 31, 2020
@jbrockmendel
Copy link
Member

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:
Copy link
Member

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?

Copy link
Member Author

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.

@mroeschke mroeschke deleted the cln/rolling branch August 31, 2020 22:11
jbrockmendel pushed a commit to jbrockmendel/pandas that referenced this pull request Aug 31, 2020
* CLN: rolling.py

* Use obj._constructor instead

Co-authored-by: Matt Roeschke <[email protected]>
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
* CLN: rolling.py

* Use obj._constructor instead

Co-authored-by: Matt Roeschke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants