Python Forum
Correlation of Incidents using time difference
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Correlation of Incidents using time difference
#1
Hi All,

I'm a newbee in Python. Mostly I need to handle files. Lets say, I have a data dump which has records of Incidents for many nodes. A single node can have multiple issues. Now I need to correlate these incidents in order, so that I can have a clear picture over parent Issue and Child issues. For this, I need to filter those incidents group by nodes based on Incident-Occurrence time criteria and the time difference between the first incident and the successor incidents should be less than 15 mins for the same node.

I'm willing to do this through pandas, groupby and conditional statements. If possible, I need a new column to get generated as Parent-child, where I can able to find the respective parent-child issues for the same node

Below is the sample input data:

Node Incident Start time Clear time Incident No Status
714851 INCORRECT OPERATING STATE 16-06-2019 0:42:33 16-06-2019 8:34:19 IM0021 Closed
714851 WDU HAS NO REDUNDANCY 16-06-2019 0:31:29 16-06-2019 8:31:29 IM0013 Closed
720107 INCORRECT WORKING STATE 16-06-2019 12:32:45 IM0046 Open
720107 UNIT TYPE HAS NO REDUNDANCY 16-06-2019 12:38:53 IM0057 Open
720107 WDU hanged 16-06-2019 12:36:53 IM0059 Open
157681 CS U-PLANE CONNECTION FAIL 16-06-2019 14:38:53 17-06-2019 16:38:53 IM0024 Closed
157681 RF unit failure 16-06-2019 18:38:53 IM0064 Open

Output needed is :

Node Incident Start time Clear time Incident No Status Parent-child
714851 INCORRECT OPERATING STATE 16-06-2019 0:42:33 16-06-2019 8:34:19 IM0021 Closed Child1
714851 WDU HAS NO REDUNDANCY 16-06-2019 0:31:29 16-06-2019 8:31:29 IM0013 Closed Parent1
720107 INCORRECT WORKING STATE 16-06-2019 12:32:45 IM0046 Open Parent2
720107 UNIT TYPE HAS NO REDUNDANCY 16-06-2019 12:38:53 IM0059 Open Child2
720107 WDU hanged 16-06-2019 12:36:53 IM0059 Open Child2

Any lights on this.? Thanks in advance.
Reply
#2
Is this an assignment?
Please show what you have attempted so far.
Thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  time difference bettwenn logs enkliy 14 466 Nov-21-2023, 04:51 PM
Last Post: rob101
  Hard time trying to figure out the difference between two strings carecavoador 2 448 Aug-16-2023, 04:53 PM
Last Post: carecavoador
  Sum up Time difference tester_V 10 1,679 Apr-06-2023, 06:54 AM
Last Post: Gribouillis
  Error in find pearson correlation function erneelgupta 1 1,530 Mar-01-2022, 03:41 PM
Last Post: stevendaprano
  How to increase the size of a png picture for the heatmap of the correlation? lulu43366 9 2,922 Oct-06-2021, 04:15 PM
Last Post: deanhystad
  How to remove a column or two columns in a correlation heatmap? lulu43366 3 4,463 Sep-30-2021, 03:47 PM
Last Post: lulu43366
  How to get indices of minimum time difference Mekala 1 1,955 Nov-10-2020, 11:09 PM
Last Post: deanhystad
  How to calculate time difference between each row of dataframe in seconds Mekala 1 2,275 Jul-16-2020, 12:57 PM
Last Post: Larz60+
  Correlation thomaschu 0 1,413 Jan-29-2020, 05:45 PM
Last Post: thomaschu
  Computing correlation in audio files ryanblumenow 0 2,547 Jan-15-2020, 06:11 PM
Last Post: ryanblumenow

Forum Jump:

User Panel Messages

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