DataFramesMeta.jl
DataFramesMeta.jl copied to clipboard
Add a `@bycol` macro-flag
Can't believe this doesn't exist. I would really like it.
@MatthewRGonzalez do you want to make a PR?
Sure-- I'll check this out @pdeffebach
@MatthewRGonzalez I've marked this as 1.0.
I want to get a 1.0 release together soon. People are going to get mad if we do too many v0.x.0
releases. But I think this is a feature that should go into 1.0
@pdeffebach Do you have any examples in mind for applications of the @bycol
flag? Are you looking for something like:
@chain df begin
transform(@bycol r"x" .=> mean)
end
as opposed to
@chain df begin
transform(Cols(r"x") .=> mean)
end
No, @bycol
is the opposite of @byrow
.
@transform df @bycol :y = f(:x)
gets lowered to
transform(df, :x => f => :y)
that is, it's redundant by itself. But if you have a block it matters
@rtransform df begin
:z = g(:a)
@bycol :y = f(:x)
end
gets lowered to
transform(df,
:a => ByRow(g) => :z,
:x => f => :y)
Got it-- I'll start working!