Apr-09-2022, 12:49 PM
Hi,
I have two data frames of different size. I want to map name in df1 to in df2 name & time stamp.
There are same name but different time stamp. I want to capture correct time stamp(early one to early and later one to later. Some time three repeating names).
I have two data frames of different size. I want to map name in df1 to in df2 name & time stamp.
There are same name but different time stamp. I want to capture correct time stamp(early one to early and later one to later. Some time three repeating names).
df1: Name ID time A.01 x.00 2022-04-01 10:20:10.123 B.08 y.00 2022-04-01 11:20:10.123 A.01 x.00 2022-04-02 23:20:10.052 C.10 w.02 2022-04-02 15:34:15.823 C.12 w.02 2022-04-06 20:34:15.823df2:
Name ID time A.01 S 2022-04-01 10:50:10.236 A.01 E 2022-04-01 10:59:10.145 A.01 N 2022-04-01 10:59:40.145 B.08 S 2022-04-01 11:50:34.203 B.08 E 2022-04-01 11:20:10.123 B.08 P 2022-04-01 11:40:15.123 A.01 S 2022-04-02 23:20:10.052 A.01 E 2022-04-02 23:20:10.052 A.01 Z 2022-04-02 23:48:10.052 A.01 P 2022-04-02 23:53:10.052 C.10 S 2022-04-02 15:34:15.823 C.10 E 2022-04-02 16:34:15.823 C.10 K 2022-04-02 16:51:15.823 C.12 S 2022-04-06 20:34:15.823 C.12 E 2022-04-06 20:40:15.823 C.12 K 2022-04-06 20:44:15.823 C.12 P 2022-04-06 20:56:15.823Out:
Name ID time ID_S_time ID_E_time A.01 x.00 2022-04-01 10:20:10.123 2022-04-01 10:50:10.236 2022-04-01 10:59:10.145 B.08 y.00 2022-04-01 11:20:10.123 2022-04-01 11:50:34.203 2022-04-01 11:20:10.123 A.01 x.00 2022-04-02 23:20:10.052 2022-04-02 23:20:10.052 2022-04-02 23:20:10.052 C.10 w.02 2022-04-02 15:34:15.823 2022-04-02 15:34:15.823 2022-04-02 16:34:15.823 C.12 w.02 2022-04-06 20:34:15.823 2022-04-06 20:34:15.823 2022-04-06 20:40:15.823