You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. Entropy calculation fails. Note if we do that without groupby, just for series, everything will be ok.
Seems that it was fixed by #6036, thank you. I will close this.
I only don't understand what you'd expect from entropy(len).
It was entropy(unique_counts / len) where unique_counts / len are pk - discrete probabilities.
For some reasons, entropy calculates correctly only if values in series are prepared discrete probabilities. So we need to calculate pk before entropy.
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. Entropy calculation fails.
Note if we do that without groupby, just for series, everything will be ok.
Reproducible example
Expected behavior
This computation should returns
Installed versions
The text was updated successfully, but these errors were encountered: