Hi, I’m trying to drop rows based on a condition rather than excluding rows from my dataframe.
I don’t understand why this piece of code doesn’t work:
autos = autos.drop(autos[(autos['price'] < 1) & (autos['price'] > 3000000)].index)
I know it doesn’t work because when I run the line below it still shows me values over 3M:
autos["price"].value_counts().sort_index(ascending = False).head()
This is not a blocker but I’d like to understand why it doesn’t work.