I have a Python dataframe as below:

I need to merge the rows which have the same unique ID with the below criteria:
- Keep the data with the latest date only. If two rows have the same date, use the data which is not blank
So the output should look like
I am new to Python. I tried to use merge but could not get the result as expected.