Skip to content
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

feat!: Preserve nulls in ewm_mean, ewm_std, and ewm_var #15503

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented Apr 6, 2024

closes #15258

This is a breaking change, so should wait for 1.0

I discussed it Ritchie and others at PyCon Lithuania, and people think this change makes sense. If a user wants their null values filled in, they can just .forward_fill - but it doesn't seem correct to do so on their behalf

Example

Before:

>>> s = pl.Series([1, 4, None, 3])
>>> s.ewm_mean(alpha=.9, ignore_nulls=False)
shape: (4,)
Series: '' [f64]
[
        1.0
        3.727273
        3.727273
        3.007913
]

After:

>>> s.ewm_mean(alpha=.9, ignore_nulls=False)
shape: (4,)
Series: '' [f64]
[
        1.0
        3.727273
        null
        3.007913
]

@github-actions github-actions bot added breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Apr 6, 2024
@MarcoGorelli MarcoGorelli added do not merge This pull requests should not be merged right now and removed python Related to Python Polars rust Related to Rust Polars breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature labels Apr 6, 2024
@github-actions github-actions bot added breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Apr 6, 2024
@MarcoGorelli MarcoGorelli force-pushed the nulls-in-ewm-mean branch 3 times, most recently from e5a73cc to 5a7e1c4 Compare April 6, 2024 08:16
@MarcoGorelli MarcoGorelli marked this pull request as ready for review April 6, 2024 08:40
Copy link

codecov bot commented Apr 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.14%. Comparing base (31df06d) to head (0fd9fcb).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15503   +/-   ##
=======================================
  Coverage   81.14%   81.14%           
=======================================
  Files        1362     1362           
  Lines      174951   174953    +2     
  Branches     2533     2533           
=======================================
+ Hits       141960   141970   +10     
+ Misses      32508    32500    -8     
  Partials      483      483           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stinodego stinodego removed the do not merge This pull requests should not be merged right now label Jun 4, 2024
@stinodego stinodego changed the title feat!: preserve nulls in ewm_mean, ewm_std, and ewm_var feat!: Preserve nulls in ewm_mean, ewm_std, and ewm_var Jun 4, 2024
@stinodego stinodego merged commit 6ea587d into pola-rs:main Jun 4, 2024
24 checks passed
Wouittone pushed a commit to Wouittone/polars that referenced this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Change that breaks backwards compatibility enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should ewm_mean preserve null values?
2 participants