1
I have 2 dataframes that I would like to merge
DF1:
MRN Encounter ID First Name Last Name Birth Date Admission D/T \
0 1 1234 John Doe 01/02/1999 04/12/2002 5:00 PM
1 2 2345 Joanne Lee 04/19/2002 04/19/2002 7:22 PM
2 3 3456 Annabelle Jones 01/02/2001 04/21/2002 5:00 PM
Discharge D/T Update D/T
0 04/13/2002 10:00 PM 04/24/2002 6:00 AM
1 04/20/2002 6:22 AM 04/24/2002 6:00 AM
2 04/23/2002 2:53 AM 04/24/2002 6:00 AM
DF2:
MRN Encounter ID First Name Last Name Birth Date Admission D/T \
0 20 987 Jerry Jones 01/02/1988 05/01/2002 2:00 PM
1 2 2345 Cosmia Lee 04/19/2002 04/19/2002 7:22 PM
2 3 3456 Annabelle Jones 01/02/2001 04/21/2002 5:00 PM
Discharge D/T Update D/T
0 05/02/2002 9:00 PM 05/17/2002 6:00 AM
1 04/20/2002 6:22 AM 05/17/2002 6:00 AM
2 04/23/2002 2:53 AM 05/17/2002 6:00 AM
The 2 Dataframes have intersection points, such as the 2 record of each df,
MRN Encounter ID First Name Last Name Birth Date Admission D/T Discharge D/T
2 3 3456 Annabelle Jones 01/02/2001 04/21/2002 5:00 PM 04/23/2002 2:53 AM
where all values are equal except "Update D/T" ( in df2 the value is most recent - 05/17/2002 6:00 AM)
It is possible to merge the 2 dataframes and for the repeated records to get the most updated value of Update D/T ?