-2

wine.drop(wine.columns[2,4,7,9,11,12], axis=1, inplace= True)

while performing this I am getting error

as too many indices for array: array is 1-dimensional, but 6 were indexed

Please help why its happening

1 Answers1

0

You can use iloc to index columns by integer indexes:

df1.drop(df1.iloc[:, [2,4,7,9,11,12]], axis=1, inplace=True)
Lorenzo Bonetti
  • 530
  • 3
  • 12