Comments (5)
Thanks for reporting, could you make a more minimal example that only uses ewm_mean please? I suspect it's another part of the computation which changed. I think cum_count changed at some point
from polars.
Oh right. .cum_count()
start value changed from 0
to 1
in 0.20.4
... as @MarcoGorelli suggested.
So the code would have to be changed from < 9
to <= 9
or < 10
Although if cum_count null behaviour also changed, something else may need adjusting to handle that?
from polars.
Thank you! My problem is solved! :-)
from polars.
Things appear to have changed in 0.20.4
and it is before .ewm_mean()
is called:
import polars as pl
values = [
143.15,143.1,143.06,143.01,143.03,143.09,143.14,143.18,
143.2,143.2,143.2,143.31,143.38,143.35,143.34,143.25,
143.33,143.3,143.33,143.36
]
(
pl.DataFrame({'value': values})
.with_columns(
pl.when(pl.col('value').cum_count() < 9)
.then(pl.col('value').head(9).mean())
.otherwise(pl.col('value'))
)
.to_dict(as_series=False)
)
0.20.3
{'value': [143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.2,
143.2,
143.31,
143.38,
143.35,
143.34,
143.25,
143.33,
143.3,
143.33,
143.36]}
0.20.4
{'value': [143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.10666666666668,
143.2, # this was 143.10666666666668 in 0.20.3
143.2,
143.2,
143.31,
143.38,
143.35,
143.34,
143.25,
143.33,
143.3,
143.33,
143.36]}
from polars.
Solved!
from polars.
Related Issues (20)
- Copy logic-plan from one LazyFrame to another LazyFrame? HOT 3
- Support converting DataFrames with matching Array types to multidimensional NumPy array
- ColumnNotFoundError appears in lazy mode only in version 0.20.28 HOT 9
- Multiple combination of expressions with Lazyframe raises PanicException
- `cluster_with_optimizer` PanicException during `scan_csv` call
- Opening large CSV files on some Macs is extremely slow. HOT 3
- Use more appropriate error variants in various places across the API
- Change `DataFrame.write_parquet(write_statistics)` to a more granular type
- LazyFrame.schema fails with "Option::unwrap()` on a `None` value" HOT 6
- Schema of `LazyFrame.with_context` does not match result of collect HOT 2
- Following a selector with .exclude() is not considered a selector HOT 3
- predicate pushdown with `pl.Expr.cut`
- `.list.to_struct()` has non-deterministic behavior HOT 5
- Add `Expr.list.map_elements(func)` to perform a custom function on every element in a list HOT 2
- pl.from_pandas(..., nan_to_null=True) does not convert NaN to Null HOT 3
- Example of `.over()` 900x slower than group_by.agg.join (and over 50x slower than pandas) HOT 5
- Non-deterministic failure when materializing LazyFrame
- LazyFrame - Unnested columns are missing in Lazy Frame HOT 4
- Add section about using `pipe` to the user guide HOT 1
- Regression: `list.sum()` inside WhenThen now returns a list HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polars.