We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
(left == right)
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
When filtering a colum in agg expression and after filtering we have 0 values, diff + multiplication may raise
pyo3_runtime.PanicException: assertion failed: `(left == right)` left: `0`, right: `1`.
Note that if we moved * 1000 all works as expected:
* 1000
pl.DataFrame({'col_to_groupby': [2], 'time': [1672740910.967138], 'col3': [1]}).groupby('col_to_groupby').agg( (pl.col('time').filter(pl.col('col3') == 0).diff().fill_null(strategy='zero') .diff().fill_null(strategy='zero') * 1000).mean().alias('fwd_iat_ho_mean').alias('calc') )
import polars as pl pl.DataFrame({'col_to_groupby': [2], 'time': [1672740910.967138], 'col3': [1]}).groupby('col_to_groupby').agg( (pl.col('time').filter(pl.col('col3') == 0).diff() * 1000).fill_null(strategy='zero') .diff().fill_null(strategy='zero').mean().alias('calc') ) pyo3_runtime.PanicException: assertion failed: `(left == right)` left: `0`, right: `1`
Computation should return:
---Version info--- Polars: 0.15.11 Index type: UInt32 Platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35 Python: 3.8.16 (default, Dec 7 2022, 01:12:06) [GCC 11.3.0] ---Optional dependencies--- pyarrow: 10.0.1 pandas: <not installed> numpy: 1.22.3 fsspec: 2022.8.2 connectorx: <not installed> xlsx2csv: <not installed> matplotlib: <not installed> None
The text was updated successfully, but these errors were encountered:
Removing some red herrings:
(pl.DataFrame({ 'col_to_groupby': [2], 'time': [1672740910.967138], 'col3': [1]}) .groupby('col_to_groupby') .agg( (pl.col('time').filter(pl.col('col3') == 0).diff() * 1000) .diff().alias('calc') ))
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Polars version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Issue description
When filtering a colum in agg expression and after filtering we have 0 values, diff + multiplication may raise
Note that if we moved
* 1000
all works as expected:Reproducible example
Expected behavior
Computation should return:
Installed versions
The text was updated successfully, but these errors were encountered: