I have a dataframe created from a CSV where I parse dates in a column named DATE
. I am looping through the rows and I want to skip everything that has the year of 1980. Here is my code:
for index, row in df.iterrows():
if df['DATE'].dt.year == 1980:
continue
I get the following error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I can print out the date fine. Any pointers would be appreciated.