-
Notifications
You must be signed in to change notification settings - Fork 370
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
Apply the same transformation to each of several inputs #2870
Comments
Note that Across may more cleanly fix #2171. |
We are discussing with @nalimilan exactly this issue currently. Both broadcasting and |
@bkamins That sounds like an interesting discussion. Are the logs available somewhere? |
The discussion in short is:
And the benefits of broadcasting
So in short: can someone give an example fo |
Would transform(df, r"temp" => Across(ByRow(t->((t-32)*5/9))) => (c->c*"celsius")) be one of these? transform(df, r"temp" .=> ByRow(t->((t-32)*5/9)) => (c->c*"celsius"))
transform(df, r"temp" .=> ByRow(t->((t-32)*5/9)) .=> (c->c*"celsius")) |
or
assuming we add the features I discussed in my previous post. The |
Just to add a slight nuance to @bkamins's summary of our discussion: I tend to think that the reason why some people find One way to convince me is to show somebody who has never used dplyr and who finds |
Why is |
For the reason I have written above - See:
As you can see there is no way to go from result one to result two (as broadcasting gets resolved BEFORE its result is passed to DataFrames.jl function). While with
and as you can see we have a |
DataFrames.jl could also provide its own string macro for convenience, for example |
https://discourse.julialang.org/t/frustrated-using-dataframes/67833 needs a way to apply the same transformation to each of several columns.
One way mentioned in the thread is
But more flexible is
Across
applies its argument to each column separately.A list of selectors might be allowed:
The text was updated successfully, but these errors were encountered: