DataFrames.jl
DataFrames.jl copied to clipboard
Integer strings as colnames/selectors are error prone
I don't know if anything can be done about this even in a breaking version but I think this is very error prone.
julia> let df = unstack(DataFrame(a=[2,1], x=["foo", "bar"]), :a, :x)
df
end
1×2 DataFrame
Row │ 2 1
│ String? String?
─────┼──────────────────
1 │ foo bar
julia> transform(
unstack(DataFrame(a=[2,1], x=["foo", "bar"]), :a, :x),
[2, 1] => ByRow(*),
["2", "1"] => ByRow(*),
)
1×4 DataFrame
Row │ 2 1 1_2_* 2_1_*
│ String? String? String String
─────┼──────────────────────────────────
1 │ foo bar barfoo foobar