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
Creating a column with only one value is only an error if it's the first column:
julia> df =DataFrame(A=1:3)
3x1 DataFrames.DataFrame
│ Row │ A │
┝━━━━━┿━━━┥
│ 1 │ 1 │
│ 2 │ 2 │
│ 3 │ 3 │
julia>@select(df, B=1, :A)
ERROR: New columns must have the same length as old columns
ininsert_single_column!(::DataFrames.DataFrame, ::DataArrays.DataArray{Int64,1}, ::Symbol) at /home/milan/.julia/DataFrames/src/dataframe/dataframe.jl:309insetindex!(::DataFrames.DataFrame, ::DataArrays.DataArray{Int64,1}, ::Symbol) at /home/milan/.julia/DataFrames/src/dataframe/dataframe.jl:368in#select#17(::Array{Any,1}, ::Any, ::DataFrames.DataFrame) at /home/milan/.julia/DataFramesMeta/src/DataFramesMeta.jl:450
[inlined code] from ./boot.jl:307in (::###8232#20{DataFrames.DataFrame})(::DataArrays.DataArray{Int64,1}) at /home/milan/.julia/DataFramesMeta/src/DataFramesMeta.jl:55ineval(::Module, ::Any) at ./boot.jl:243
julia>@select(df, :A, B=1)
3x2 DataFrames.DataFrame
│ Row │ A │ B │
┝━━━━━┿━━━┿━━━┥
│ 1 │ 1 │ 1 │
│ 2 │ 2 │ 1 │
│ 3 │ 3 │ 1 │
Would it make sense to always recycle the columns so that the new data frame has the same number of columns as the original? Other constructs could be recommended for aggregation operations.
The text was updated successfully, but these errors were encountered:
Creating a column with only one value is only an error if it's the first column:
Would it make sense to always recycle the columns so that the new data frame has the same number of columns as the original? Other constructs could be recommended for aggregation operations.
The text was updated successfully, but these errors were encountered: