-
Notifications
You must be signed in to change notification settings - Fork 125
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
Additional _
macros in Series
#730
Comments
I'm not a huge fan of the idea of We should just bring the nils opt to |
I'm leaning toward Like you say, it doesn't carry any baggage over from R. And the parallels to
(
Since We should still decide on names though. I think I'm fine with |
I think we can just call Regarding the name, we can definitely call it Anyway, I think the first step is to add |
Wait a second, I'm second guessing. Does Unless the idea is that [2, 4, 6]
|> S.from_list()
|> S.sort(remainder(_, 3))
|> S.to_list()
# [6, 4, 2]
Makes sense, might as well do that while we're in there. |
The whole underscore bit relies on it being a macro, right? |
Yep my bad, ignore me! I was looking at the docs for df = DF.new(a: [3, 2, 1])
DF.arrange(df, a) I didn't realize you could do any expression, e.g.: DF.arrange(df, 1 - a) So |
I think this issue is now closed :) Are there any other macros I'm overlooking? |
I don't think so! Great work :) |
Overview
With #728 merged, we now have a strategy for adding macros to Series. The aim is closer parity with DataFrames.
This issue follows up from #726. We need to decide:
Current Macros
DataFrames support four macros/callbacks:
arrange
/arrange_with
filter
/filter_with
mutate
/mutate_with
summarise
/summarise_with
We've already done
filter
. We probably don't want to supportsummarise
. That leavesarrange
andmutate
.Name options
DF.arrange{_with}
S.arrange{_with}
S.sort{_with}
DF.mutate{_with}
S.mutate{_with}
S.map{_with}
Considerations
S.sort
function, and it allows an additionalnils: :first | :last
option.S.transform
function which is similar toDF.mutate
, but it's for Elixir functions instead of Series functions.The text was updated successfully, but these errors were encountered: