-
Notifications
You must be signed in to change notification settings - Fork 373
Open
Description
MWE:
julia> df = DataFrame(a = [1, 2, 3])
3×1 DataFrame
Row │ a
│ Int64
─────┼───────
1 │ 1
2 │ 2
3 │ 3
julia> v = @view df[1:2, :]
2×1 SubDataFrame
Row │ a
│ Int64
─────┼───────
1 │ 1
2 │ 2
julia> select(v, :a => ByRow(x -> x + 1) => :a)
2×1 DataFrame
Row │ a
│ Int64
─────┼───────
1 │ 2
2 │ 3
julia> select(v, :a => ByRow(x -> x + 1) => :a; copycols = false)
ERROR: ArgumentError: invalid index: :a => (ByRow{var"#618#619"}(var"#618#619"()) => :a) of type Pair{Symbol, Pair{ByRow{var"#618#619"}, Symbol}}
Stacktrace:
[1] getindex(x::DataFrames.Index, idx::Pair{Symbol, Pair{ByRow{var"#618#619"}, Symbol}})
@ DataFrames ~/.julia/packages/DataFrames/rwKZk/src/other/index.jl:183
[2] manipulate(dfv::SubDataFrame{…}, args::Any; copycols::Bool, keeprows::Bool, renamecols::Bool)
@ DataFrames ~/.julia/packages/DataFrames/rwKZk/src/abstractdataframe/selection.jl:1836
[3] select(df::SubDataFrame{…}, args::Any; copycols::Bool, renamecols::Bool, threads::Bool)
@ DataFrames ~/.julia/packages/DataFrames/rwKZk/src/abstractdataframe/selection.jl:1303
[4] top-level scope
@ REPL[25]:1
Some type information was truncated. Use `show(err)` to see complete types.
julia> select(df, :a => ByRow(x -> x + 1) => :a; copycols = false)
3×1 DataFrame
Row │ a
│ Int64
─────┼───────
1 │ 2
2 │ 3
3 │ 4Metadata
Metadata
Assignees
Labels
No labels