I want to drop all rows if the value in a column matches an item in a list. I tried:
bets.drop(bets[bets["id_"] in bet_ids].index, inplace=True)
However, I got the error:
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I tried adding any()
:
bets.drop(bets[any(bets["id_"] in bet_ids)].index, inplace=True)
But get the same error.
Where am I going wrong?