-
Notifications
You must be signed in to change notification settings - Fork 112
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
Explorer.Series.pow does not work when supplied integers as exponent #105
Comments
Good catch. Unfortunately this is because I'm sure we could work around it, and at the very least document it! |
@kimjoaoun if you could also ping polars folks and ask if they want to support an int version. It could be a good contribution upstream! ❤️ |
@josevalim I'll ping them! |
Nah, you are being very helpful. Contributions are very welcome! :) |
@josevalim It looks like pow() will be removed, so I think they'll not support an |
A bit of context on my rationale to not have this included on the Doing so for many operations will put a lot of constrain on compile times of polars-core. The recommended way for a user to apply a numeric operation like Something like this. let s = Series::new("foo", [1i32, 2, 3]);
s.i32()?.apply(|v| v.pow(3)).into_series() Given that Explorer defines bindings to polars, you'd need to pattern match on the |
Thanks for the clarification @ritchie46! That makes total sense as a preferred path forward. I'm fighting against a Wednesday deadline with work at the minute but could pick this up after. Otherwise @kimjoaoun if you're keen then I can definitely give some guidance and would be happy to review a PR. |
@cigrainger I accept the guidance, I'll start working on that. If I have a question should I contact you via a PR comment? |
@kimjoaoun that's probably the best in terms of having a record to point to for others contributing. But you can also get me on the EEF or Elixir slacks (same username) or via email at chris at amplified dot ai. And thanks for taking it on! |
Explorer.Series.pow
returns an error when the user supplies an integer as exponent. It only works when exponent is a float, and I think because of that all values in the Series are casted to floating point numbers, which is not a desirable behaviour.When exponent is a integer:
When exponent is a float:
The text was updated successfully, but these errors were encountered: