Python Forum
How to map by time stamp and name
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to map by time stamp and name
#1
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).

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.823  
df2:
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.823
Out:
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Filename stamp script is needed ineuw 11 4,617 Sep-12-2023, 03:05 AM
Last Post: ineuw
  extract zip from .msg files and saving according to date stamp of email natjo 3 2,949 Aug-13-2020, 09:35 PM
Last Post: bowlofred
  copy with new time stamp leveex 0 1,796 Mar-29-2020, 08:46 PM
Last Post: leveex
  How to save latest time stamp in a file? redwood 12 7,254 Jul-11-2019, 11:03 AM
Last Post: redwood

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020