everybody!! I have a question. Imagine a Data Frame with columns [a, b, c, e, f, g, h, i, j]. I want to create a 2nd DF having only columns a, c-g. How can I do this in a single coman without creating a list putting ao the columns? For example, I'm writing in that way:
columns = ['a', 'c', 'e', 'f', 'g']
df2 = df.loc[:,~df.columns.isin(columns)]
I would know if there's something more like:
df2 = df.loc[:,'a': 'g']
But excluing the 'b' column.
This second way I did 2 comands, one to select from a-g and the second, to drop b.
I would like to know if I can selct from a-g and drop b at the same time