Berechnung der GebäudeeintrittszeitPython

Python-Programme
Anonymous
 Berechnung der Gebäudeeintrittszeit

Post by Anonymous »

Ich habe ein Szenario, um die Stunden innerhalb eines Gebäudes zusammen mit der ersten In- u n d l e t z t e n O u t - Z e i t f ü r e i n e n b e s t i m m t e n T a g a u s d e m B e r i c h t d e s G e b ä u d e z u g a n g s k a r t e n l e s e r s z u e x t r a h i e r e n . < / p > < b r / > B e i s p i e l b e r i c h t : < / p > < b r / > < d i v c l a s s = " s - t a b l e - c o n t a i n e r " > < t a b l e c l a s s = " s - t a b l e " > < b r / > < t h e a d > < b r / > < t r > < b r / > < t h > E m p I D < / t h > < b r / > < t h > D A T U M < / t h > < b r / > < t h > T y p < / t h > < b r / > < t h > Z e i t < / t h > < b r / > < / t r > < b r / > < / t h e a d > < b r / > < t b o d y > < b r / > < t r > < b r / > < t d > A B C < / t d > < b r / > < t d > 1 8 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > E i n t r a g < / t d > < b r / > < t d > 1 2 : 4 1 : 2 1 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > A B C < / t d > < b r / > < t d > 1 8 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > A u s s t i e g < / t d > < b r / > < t d > 1 3 : 4 0 : 1 2 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > A B C < / t d > < b r / > < t d > 1 8 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > E i n t r i t t < / t d > < b r / > < t d > 1 4 : 1 1 : 4 1 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > A B C < / t d > < b r / > < t d > 1 8 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > B e e n d e n < / t d > < b r / > < t d > 1 6 : 5 9 : 5 3 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > D E F < / t d > < b r / > < t d > 0 8 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > E i n t r i t t < / t d > < b r / > < t d > 0 9 : 5 8 : 4 8 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > D E F < / t d > < b r / > < t d > 0 8 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > A u s s t i e g < / t d > < b r / > < t d > 1 5 : 4 1 : 3 5 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > D E F < / t d > < b r / > < t d > 0 8 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > E i n t r a g < / t d > < b r / > < t d > 1 5 : 4 1 : 4 6 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > D E F < / t d > < b r / > < t d > 0 8 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > A u s g a n g < / t d > < b r / > < t d > 1 6 : 5 9 : 5 5 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 0 9 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > E i n t r i t t < / t d > < b r / > < t d > 1 0 : 1 0 : 5 6 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 0 9 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > B e e n d e n < / t d > < b r / > < t d > 1 2 : 3 7 : 1 8 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 1 1 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > E i n t r i t t < / t d > < b r / > < t d > 1 0 : 0 1 : 4 4 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 1 1 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > A u s s t i e g < / t d > < b r / > < t d > 1 2 : 1 8 : 0 0 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 1 5 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > E i n t r a g < / t d > < b r / > < t d > 0 9 : 4 9 : 5 0 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 1 5 . 1 2 . 2 0 2 5 < / t d > < b r / > < t d > A u s s t i e g < / t d > < b r / > < t d > 1 1 : 0 8 : 5 6 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 1 5 . 1 2 . 2 0 2 5 < / t d > < b r / > < t d > E i n t r i t t < / t d > < b r / > < t d > 1 1 : 2 9 : 3 2 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 1 5 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > B e e n d e n < / t d > < b r / > < t d > 1 2 : 4 7 : 0 1 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 1 5 . 1 2 . 2 0 2 5 < / t d > < b r / > < t d > E i n t r i t t < / t d > < b r / > < t d > 1 2 : 4 7 : 1 6 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > I J K < / t d > < b r / > < t d > 1 5 . 1 2 . 2 0 2 5 < / t d > < b r / > < t d > A u s s t i e g < / t d > < b r / > < t d > 1 2 : 4 7 : 5 7 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > < t d > X Y Z < / t d > < b r / > < t d > 1 6 - 1 2 - 2 0 2 5 < / t d > < b r / > < t d > E i n t r a g < / t d > < b r / > < t d > 1 0 : 3 8 : 5 8 < / t d > < b r / > < / t r > < b r / > < t r > < b r / > XYZ
16-12-2025
Ausgang
11:15:20


XYZ
16-12-2025
Eintritt
16:27:28



Erwartete Ausgabe:



Emp ID
DATUM
Typ
Zeit
First InTime
Last Out Time
Gesamtstunden
Stunden innerhalb




ABC
18-12-2025
Eintrag
12:41:21
12:41:21
16:59:53
04:18:32
03:18:00


ABC
18-12-2025
Beenden
13:40:12
12:41:21
16:59:53
04:18:32
03:18:00


ABC
18-12-2025
Eintrag
14:11:41
12:41:21
16:59:53
04:18:32
03:18:00


ABC
18-12-2025
Beenden
16:59:53
12:41:21
16:59:53
04:18:32
03:18:00


DEF
08-12-2025
Eintrag
09:58:48
09:58:48
16:59:55
07:01:07
05:01:00


DEF
08-12-2025
Beenden
15:41:35
09:58:48
16:59:55
07:01:07
05:01:00


DEF
08-12-2025
Eintrag
15:41:46
09:58:48
16:59:55
07:01:07
05:01:00


DEF
08-12-2025
Ausstieg
16:59:55
09:58:48
16:59:55
07:01:07
05:01:00


IJK
09-12-2025
Eintrag
10:10:56
10:10:56
12:37:18
02:26:22
00:52:00


IJK
09-12-2025
Beenden
12:37:18
10:10:56
12:37:18
02:26:22
00:52:00


IJK
11-12-2025
Eintrag
10:01:44
10:01:44
12:18:00
02:16:16
01:23:00


IJK
11-12-2025
Beenden
12:18:00
10:01:44
12:18:00
02:16:16
01:23:00


IJK
15-12-2025
Eintrag
09:49:50
09:49:50
12:47:57
02:58:07
01:30:00


IJK
15-12-2025
Beenden
11:08:56
09:49:50
12:47:57
02:58:07
01:30:00


IJK
15-12-2025
Eintrag
11:29:32
09:49:50
12:47:57
02:58:07
01:30:00


IJK
15-12-2025
Beenden
12:47:01
09:49:50
12:47:57
02:58:07
01:30:00


IJK
15-12-2025
Eintrag
12:47:16
09:49:50
12:47:57
02:58:07
01:30:00


IJK
15-12-2025
Beenden
12:47:57
09:49:50
12:47:57
02:58:07
01:30:00


XYZ
16-12-2025
Eintrag
10:38:58
10:38:58
11:15:20
00:36:22
01:30:00


XYZ
16-12-2025
Ausstieg
11:15:20
10:38:58
11:15:20
00:36:22
01:30:00


XYZ
16-12-2025
Eintrag
16:27:28
10:38:58
11:15:20
00:36:22
01:30:00



Ich konnte die Codierung zum Abrufen der ersten und letzten Zugriffsdetails mithilfe des folgenden Skripts durchführen:

Code: Select all

def compute_day(group:  pd.DataFrame):
# First Entry / Last Exit
first_entry = group['ENTRY_TS'].min()
last_exit   = group['ENTRY_TS'].max()
Ich kann keine Logik/Code zur Überprüfung der Öffnungszeiten im Gebäude erhalten. Es sollte eine Differenzzeit zwischen Exit und Entry zwischen dem ersten Entry und dem letzten Exit sein.
Bitte helfen Sie

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post