I am trying to subset a pandas dataframe based on several conditions. I have attempted something like this:
subset_df = df[((df['language'] != 'es') and (df['language'] == 'eu')) | ((df['language'] == 'es') and (df['lang_conf'] < 1))]
But I get this error:
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Any ideas of how I could make this work or some different solution to achieve subsetting based on several nested conditions?