0

I have a df with 39 columns. Two of these columns are "duplicate" and "high_val_txn". Both these columns contain boolean value ( True or False). I want to filter out those rows which have True in duplicate or True in high_val_txn. I want to save these rows in a new dataframe and remove any duplicate rows if any. I wrote the following code to do so.

workable_df=df[(df['duplicate']==True) and (df['high_val_txn']==True)]

but it gives the following error:

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Soumya Pandey
  • 321
  • 3
  • 19

0 Answers0