Giter Club home page Giter Club logo

Comments (9)

ritchie46 avatar ritchie46 commented on June 29, 2024 2

A bit of context on my rationale to not have this included on the Series trait is that this will be compiled for every datatype in polars.

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 pow, sin exp etc. is downcasting the Series to the ChunkedArray and then calling apply

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 dtype and downcast to the appropriate type.

from explorer.

cigrainger avatar cigrainger commented on June 29, 2024 2

@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!

from explorer.

josevalim avatar josevalim commented on June 29, 2024 1

Nah, you are being very helpful. Contributions are very welcome! :)

from explorer.

cigrainger avatar cigrainger commented on June 29, 2024

Good catch. Unfortunately this is because polars only takes f64 for the pow method: https://docs.rs/polars/0.18.0/polars/prelude/trait.SeriesTrait.html#method.pow.

I'm sure we could work around it, and at the very least document it!

from explorer.

josevalim avatar josevalim commented on June 29, 2024

@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! ❤️

from explorer.

kimjoaoun avatar kimjoaoun commented on June 29, 2024

@josevalim I'll ping them!
(se eu estiver sendo chato abrindo várias issues, por favor, me avise)

from explorer.

kimjoaoun avatar kimjoaoun commented on June 29, 2024

@josevalim It looks like pow() will be removed, so I think they'll not support an int version. I think we would need to do what ritchie46 suggested and coerce our integer to a float.

from explorer.

cigrainger avatar cigrainger commented on June 29, 2024

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.

from explorer.

kimjoaoun avatar kimjoaoun commented on June 29, 2024

@cigrainger I accept the guidance, I'll start working on that. If I have a question should I contact you via a PR comment?

from explorer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.