I have dataframe like below:
Date1 Date2
25-11-2020 23-11-2020
27-11-2020
26-11-2020
29-11-2020 27-11-2020
29-11-2020
23-11-2020 27-11-2020
I need to apply the below conditions on the dataframe:
- If Date1 and Date2 are present then Select Date 1
- Date 1 is null or not present select Date 2
Expected Output
Date1 Date2 Date_Select
25-11-2020 23-11-2020 25-11-2020
27-11-2020 27-11-2020
26-11-2020 26-11-2020
29-11-2020 27-11-2020 29-11-2020
29-11-2020 29-11-2020
23-11-2020 27-11-2020 23-11-2020
How can this be in python?