need your help on creating new column.
- create new column
- if Date < Current Month and Year = change to value to Current Month and Year (MMM-YY)
- if Date >= Current Month and Year = no change
here is an example, all red are in the past hence in the new column the new date is this month (Aug-22)
I tried below but no luck:
string_input_with_date = df["Old Column"]
past = datetime.strptime(string_input_with_date, "%b-%y")
present = datetime.now()
past.date() < present.date()
[enter image description here]
