I've a dataframe and I need to make filter based on two conditions: If first_name = 'Aleshia' OR if last_name = 'Andrade'
I was trying with the code below:
import pandas as pd
df = pd.read_csv('https://s3-eu-west-1.amazonaws.com/shanebucket/downloads/uk-500.csv')
data_new = df[df.first_name == 'Aleshia' or df.last_name == 'Andrade']
print(data_new)
But I am getting the following error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
What I am doing wrong?