I am trying to drop multiple columns (column 2 and 70 in my data set, indexed as 1 and 69 respectively) by index number in a pandas data frame with the following code:
Try this
df.drop(df.iloc[:, 1:69], inplace=True, axis=1)
This works for me
You don't need to wrap it in a list with [..], just provide the subselection of the columns index:
[..]
df.drop(df.columns[[1, 69]], axis=1, inplace=True)
as the index object is already regarded as list-like.