[Python] Get 3 rows from a Pandas Dataframe with the latest timestamp entry for a specific...

Discussão em 'Python' iniciado por Stack, Fevereiro 21, 2025.

  1. Stack

    Stack Membro Participativo

    I have put the following log data to a pandas dataframe. Now i want to get the 3 rows with target_label= 'Security Alert' having the most recent timestamps In the following table the third column is the target_label column,

    1759,12/29/2025 20:33,ModernCRM,Unauthorised access attempt from 192.168.99.79 detected,Security Alert,bert 2213,9/1/2025 10:30,AnalyticsEngine,Security alert: suspicious activity from 192.168.214.63,Security Alert,bert 168,5/19/2025 7:56,ModernHR,Multiple incorrect login attempts were made by user 7918,Security Alert,bert 1844,6/10/2025 8:39,ThirdPartyAPI,"Alert: server 9 experienced unusual login attempts, security risk",Security Alert,bert 961,4/26/2025 5:21,ThirdPartyAPI,API access audit trail shows unauthorized entry for user 5627,Security Alert,bert 1077,3/4/2025 9:49,AnalyticsEngine,"Anomalous activity identified on server 47, security review recommended",Security Alert,bert 1356,5/3/2025 13:03,ThirdPartyAPI,Multiple rejected login attempts found for user 1805,Security Alert,bert 43,11/22/2025 11:06,BillingSystem,"Abnormal system behavior on server 40, potential security breach",Security Alert,bert 2062,6/7/2025 1:22,AnalyticsEngine,"Server 11 experienced potential security incident, review required",Security Alert,bert 769,4/28/2025 4:07,ModernHR,API access denied due to unauthorized credentials for user 5914,Security Alert,bert

    Continue reading...

Compartilhe esta Página