still learning python and have a previous SAS background. Want to compare two date columns and have a string column based on the result.
example is below
essentially, if fee_paid_date is before close date, then say"fee paid before closed" else "fee paid during open"
so here is what i did
main_df["Payment_validity"] = main_df['fee_paid_date'].apply(lambda x: 'Fee paid while open' if x <=main_df['PACKAGE_D_CLOSE'] else 'Fee paid after closed ')
and 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().
Any help is much appreciated
