Description
This issue is for discussion about standardizing the following syntaxes for creating new columns in data frames. We currently have two approaches, the symbol goes first or it goes second.
Constructor: df = DataFrame(:a => [1, 2], :b => [5, 6])
. This syntax is currently only possible as the Pair
version of syntax for keyword arguments.
insertcols!
: This woks like a constructor, insertcols!(df, 3, :c => ["a", "b"])
. This is not implemented only through standard keyword argyment syntax but rather through an actual Pair{Symbol, <:Any}
method.
Future transform
. After discussions in #1975, we have settled on having transform(df, :b => f => :d)
. Notice here that :d
is at the end of this command, indicating "at the end of this operation, we create it all goes into a new column :d
".
There is an inconsistency here. With insertcols
, :b => v
isn't putting v
in the column :b
the same way the transform
syntax works.
I think we should standardize around having a Symbol
at the end. But this makes a lot of complications. For instance, we might need to get rid of keyword arguments in the constructor, otherwise :b => v
would be valid syntax due to default Julia syntax.
Consequently I think the issue merits discussion.
Activity