Use of Not() in select() with a function

I try to use Not() column selector when applying a function in select() without success

julia> df = DataFrame(id1 = 1:2, id2 = 1:2)
2×2 DataFrame
 Row │ id1    id2   
     │ Int64  Int64 
─────┼──────────────
   1 │     1      1
   2 │     2      2

julia> select(df, Not(:id1))
2×1 DataFrame
 Row │ id2   
     │ Int64 
─────┼───────
   1 │     1
   2 │     2

julia> select(df, Not(:id1) .= x -> x.^2)
ERROR: MethodError: no method matching ndims(::Type{InvertedIndex{Symbol}})

Thank you for your help!

Not is currently not broadcastable. For the time being you need names(df, Not(:id1))

1 Like

Thank you!