-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add log/2 and exponential/1 to Series #549
Conversation
This only accepts numbers as bases.
@doc type: :element_wise | ||
@spec log(argument :: Series.t(), base :: number()) :: Series.t() | ||
def log(argument, base) when is_number(base) do | ||
if base <= 0, do: raise(ArgumentError, "base must be a positive number") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msluszniak we do support it, it seems the error is elsewhere. Likely Kino.Explorer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, probably the aggregate functions like min, max, and mean don't work properly. I'll send an issue to Kino.Explorer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug is in Explorer as well. Reported here: #550
|
||
""" | ||
@doc type: :element_wise | ||
@spec log(argument :: Series.t()) :: Series.t() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of having a default value, I think we should really call log/1
in the backend. This will help us avoid precision issues if we support multiple float types in the future and I believe the natural log may be more optimized. For example, it seems Rust implements all other logs are implemented on top of ln
: https://doc.rust-lang.org/src/std/f64.rs.html#428-430
May close #548
This version only accepts
log(series, number)
, since Polars implements the equivalent for series.Do you think we need
log(series, series)
andlog(number, series)
? If so, I can implement in upcoming PRs.Also, I don't know much about
exponential
, so please help me documenting that.cc/ @msluszniak @kimjoaoun