dimanche 5 janvier 2020

Value error while tryin IF condition for creating new column in python [duplicate]

This question already has an answer here:

I am trying to create a new column basis the condition below which I have passed in the if statement. I end up getting an error -ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()

Below is the code:

if (concat_2020['Final RP_date']> concat_2020['R&P date_planner']):

    concat_2020['RP status'] = True

else:
    concat_2020['RP status'] = False

Aucun commentaire:

Enregistrer un commentaire