and btw both are pretty verbose (:
E.g.,
transform(df, :a => @_ exp.(_.^2) => :exp_a_square, :a => @_ _.^2 => :a_square)
for a dataframe vs
@p mutate(exp_a_square=exp(_.a^2), a_square=_.a^2, df)
with DataPipes
for other tables.
Not even talking about multicolumn functions:
@p mutate(comp_val=_.a > _.b ? _.a^2 : _.a, df)
With Base
only (no DataPipes
) the first example becomes somewhat less pretty, but still shorter than for dataframes:
map(r -> (r..., exp_a_square=exp(r.a^2), a_square=r.a^2), df)