-
Notifications
You must be signed in to change notification settings - Fork 55
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 a @transform! mutating version #110
Comments
Yes, that sounds quite easy to do, given that You just need to define There's a more tricky case when the argument is a |
Thanks for the idea. Actually, let me make it even better, since variadic makes a lot of sense here. using DataFrames, DataFramesMeta
df = DataFrame(a=[1; 2; 3], b=[10; 12; 13])
f(a, b) = a + b
@transform!(df, c = f.(:a, :b), d = :a + :b) instead of using DataFrames, DataFramesMeta
df = DataFrame(a=[1; 2; 3], b=[10; 12; 13])
f(a, b) = a + b
df =@transform(df, c = f.(:a, :b), d = :a + :b) EDIT: Looks like |
One thing to note is that if you are doing a mutating transforms over and over again,
|
This would actually a bit tough for a grouped data frame. Because
|
I just created a PR for this, but I think we should have more discussion about whether or not it is the right strategy. It's nice that this is an opinionated package where there is one way of doing each thing. I might prefer to have just one, albeit copying, macro for each operation than face a splintered API. Despite opening the PR I might wonder if we can convince users to get used to copying, and make sure that everything is as performant as possible. |
Having in-place versions of operations that otherwise do a deep copy of the dataframe would be particularly useful: it would make it easier to work with dataframes with a size close to the maximum amount of RAM. If I understand correctly, this would apply to |
Yes I agree. Though I haven't heard too many complaints to this effect with I just added a commit in #119 making some more progress. |
Closed via #216 |
In order to port over Stata and R code, it is nice to have succinct calculations of new columns based on existing values. Right now,
But it would be great if this could instead be:
Is this a relatively easy change for someone to add a PR?
The text was updated successfully, but these errors were encountered: