Select colums by the value of rows

You could also select columns via a predicate like so:

julia> collect(df[1, :])
6-element Vector{Int64}:
 1
 2
 3
 4
 5
 6

julia> 3 .<= ans .<= 5
6-element BitVector:
 0
 0
 1
 1
 1
 0

julia> df[!, ans] # use ! to return a view; use : to copy
1×3 DataFrame
 Row │ x1     x2     y1
     │ Int64  Int64  Int64
─────┼─────────────────────
   1 │     3      4      5