https://github.com/JuliaLang/julia/pull/32310 made me think of a discussion I'd had about data frames and wanting to be able to write columns(df)
to access a data frame as a collection of columns. We could make eachcol(df)
work like that but the each
in the name gets a bit weird. So perhaps we might want to rename (or alias until 2.0) eachcol
to columns
and make it act more like a view of the underlying collection than as just an iterator. There would be corresponding rows
and slices
view wrappers. Thoughts?
In DataFrames.jl eachcol
and eachrow
already produce AbstractArray
objects. eachcol
and eachrow
were simply legacy names (and consistent with Base).
Therefore, at least from DataFrames.jl perspective it is not a problem if in Base the following decision were made:
columns
and rows
as target function names and define const eachcol = columns
and const eachrow = rows
temporarily;eachrow
and eachcol
aliasesIndeed the "each" prefix sounds a bit off when the function returns (or could return) an AbstractVector
, so +1 to switching to rows
, columns
and slices
.
The approach would be to make rows
, columns
and slices
the primary names and leave the each*
versions around but document them as being deprecated and then actually deprecate them in 2.0.
+1 for this change. Although this was originally discussed in #14491 (comment), where it was decided against rows
, columns
, slices
and in favor of each*
.
Most helpful comment
The approach would be to make
rows
,columns
andslices
the primary names and leave theeach*
versions around but document them as being deprecated and then actually deprecate them in 2.0.