-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add ignore_nulls
(and ignore_nan
) option to xdt.ewma_by_time
#71
Comments
thanks @wbeardall for the request! seems reasonable, will take a look |
I've submitted a PR for how I'd go about implementing this. Let me know any thoughts! |
Are you sure this is what the
Looks like NaN values still propagate there? Which looks correct to me - Polars (unlike pandas) generally distinguishes NaN and null |
I think you might be right here; in honesty, I'm a very recent convert from Pandas, and may have mistaken the design pattern in
My particular use-cases, and the PR that I submitted last night, are focused on the |
ignore_nulls
option to xdt.ewma_by_time
ignore_nulls
(and ignore_nan
) option to xdt.ewma_by_time
Perhaps it is better to propagate NaNs, whilst having
|
yeah doing |
I've pushed an implementation for the above, as well as improving robustness. In the previous version, if a series started with a null value, the kernel would panic, as it would attempt to call |
Currently, if there are any NaN values in the value column passed to
xdt.ewma_by_time
, then all following values in the output are NaN (see snippet). It would be great if there was nignore_nulls
flag, similar to in the builtinewma
, to allow for NaN or null values to be ignored during calculation, to prevent this. In this case, the presence or absence of a row containing Null or NaN should have no effect on subsequent rows; i.e. theewma
-ed output of the final row of the two following tables should be identical.Reproducible snippet
The text was updated successfully, but these errors were encountered: