Unlike that question, I’m asking it more in general. What if you want cols::Vector to be placed in the front. Doing something with indexes is not really convenient. Even worse, what if you want the cols to be placed at position 2?
The reason that I ask is because select(df, cols, Not(cols)) is not so readable and I’ve learned that whenever I need to make a function for something which seems like basic DataFrames functionality, I’m probably doing something wrong.
I would have expected something like movecols!(df, 1, cols) similar to insertcols!.
I find select(df, cols, :) quite readable. Similarly, to insert them at position 2 you can use select(df, 1, cols, :). Or for position 3, select(df, 1:2, cols, :).
Exactly as @sijo explains there is no need to use Not. In this case : is treated as every column except what was already included up to this point.
The general design goal of DataFrames.jl is to minimize the number of verbs the user has to learn so select and select! were judged to be enough as they should be flexible enough in most cases.