0

I have a dataframe which has a column "Budget". I want to get all the rows from dataframe whose value corresponding to budget column is 0. I using this code:

dataFrameTrain.iloc[np.where(dataFrameTrain['budget']==0),:]

But, I am getting this exception:

IndexingError: Too many indexers

V K
  • 1,645
  • 3
  • 26
  • 57
  • Possible duplicate of [Select rows from a DataFrame based on values in a column in pandas](https://stackoverflow.com/questions/17071871/select-rows-from-a-dataframe-based-on-values-in-a-column-in-pandas) – Sociopath Oct 30 '19 at 10:45

1 Answers1

1

You want do a boolean indexing:

dataFrameTrain[dataFrameTrain['budget']==0]
ansev
  • 30,322
  • 5
  • 17
  • 31