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
  Error in find pearson correlation function erneelgupta 1 757 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 1,575 Oct-06-2021, 04:15 PM
Last Post: deanhystad
  How to remove a column or two columns in a correlation heatmap? lulu43366 3 2,336 Sep-30-2021, 03:47 PM
Last Post: lulu43366
  How to get indices of minimum time difference Mekala 1 1,457 Nov-10-2020, 11:09 PM
Last Post: deanhystad
  How to calculate time difference between each row of dataframe in seconds Mekala 1 1,623 Jul-16-2020, 12:57 PM
Last Post: Larz60+
  Correlation thomaschu 0 1,145 Jan-29-2020, 05:45 PM
Last Post: thomaschu
  Computing correlation in audio files ryanblumenow 0 1,956 Jan-15-2020, 06:11 PM
Last Post: ryanblumenow
  Correlation Matrix Problem Pmllz 0 1,639 Feb-02-2019, 10:19 PM
Last Post: Pmllz
  Correlation & Prediction - Help Danijel 2 2,182 Jul-12-2018, 11:08 PM
Last Post: Danijel
  Time Difference in Epoch Microseconds then convert to human readable firesh 4 9,920 Feb-27-2018, 09:08 AM
Last Post: firesh

Forum Jump:

User Panel Messages

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