I have the following problem:
Given a pandas dataframe with a number of unique hostnames, I would like to plot a horizontal bar graph that indicates the length of time that a particular issue occurred with this hostname.
I have the following code:
# Create a bar plot for each unique system name of all ticket entries
for sys_name in unique_sys_names:
# Grab the df that refers to just the issues with that system name
j_data_sys = eff_j_data[eff_j_data['System Name'] == sys_name]
eff_j_data_sys = j_data_sys[['Created','Resolved','Summary']]
eff_j_data_sys.plot.barh(x=eff_j_data_sys['Resolved']-eff_j_data_sys['Created'],y=range(0,len(eff_j_data_sys)))
Essentially, I have unique hostnames in a larger pandas dataframe, each with an issue ranging from 1 to N. In the for loop, I simply iterate through the unique hostnames (sys_name) and then I grab all the issues related to that hostname in j_data_sys. I then grab all the times that each issue was created and resolved as well as the Summary of the issue. All I would like to do is indicated in the following image: Example Bar Plot
Of course, this could include N issues, each with corresponding timestamps of start and finished.
An example dataframe containing this data would be:
Created Resolved Summary
9 2016-04-25 10:29:00 2016-04-26 13:22:00 1 Blade Missing
10 2016-04-25 10:10:00 2016-04-25 10:23:00 Blade in Lockdown
Any other suggestions as to best represent this data in a time appropriate way is recommended.
Thank you,
