jeudi 30 janvier 2020

Using If statement in a pandas data set [duplicate]

I have been trying to use an if statement for a pandas dataset, but I keep getting this error: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

My code:

if (df['Year'] == 2013):
print(df['Name'])

Aucun commentaire:

Enregistrer un commentaire