You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to stack a df where a column name is "variable", the stack command suggests to use "makeunique", but then this lead to an error:
julia> df =DataFrame(
foo = ["a","a","b"],
variable = ["a","a","a"],
v1 = [1,1.5,2],
v2 = [10,11.5,13.5]
)
3×4 DataFrame
Row │ foo variable v1 v2
│ String String Float64 Float64
─────┼────────────────────────────────────
1 │ a a 1.010.02 │ a a 1.511.53 │ b a 2.013.5
julia>stack(df)
ERROR: ArgumentError: Duplicate variable names::variable. Pass makeunique=true to make them unique using a suffix automatically.
Stacktrace:
[1] make_unique!(names::Vector{Symbol}, src::Vector{Symbol}; makeunique::Bool)
julia>stack(df,makeunique=true)
ERROR: MethodError: no method matching stack(::DataFrame, ::Vector{Int64}, ::InvertedIndex{Vector{Int64}}; makeunique::Bool)
This error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented.
Likely the message should say instead to specify the column to host the values to stack with the keyword argument variable_name.
The text was updated successfully, but these errors were encountered:
When trying to stack a df where a column name is "variable", the
stack
command suggests to use "makeunique", but then this lead to an error:Likely the message should say instead to specify the column to host the values to stack with the keyword argument
variable_name
.The text was updated successfully, but these errors were encountered: