import pandas as pd
from numpy import genfromtxt
import matplotlib.pyplot as plt
import io
path="uptimerobot-RP&SPublicAvailability-logs.csv"
df=pd.read_csv(path)
df.drop(['Reason', 'Monitor URL','Date-Time','Duration'], axis = 1, inplace = True)
data=df['Duration_min'][df['Event']=='Down'].sum()
data2=genfromtxt(BytesIO(data),delimiter=',',dtype=None)
plt.xlabel('Down')
plt.ylabel('Duration in min')
plt.show(data2)
plt.savefig('my_figure.png')
Solved! Solved! Go to Solution.
I am having problems to get the graph displayed, any suggestion?Thank you all!
Thank you! Yes, this is the solution.
df=pd.read_csv("document.csv")
data=df['Duration_min'][df['Event']=='Down']
plt.xlabel('number of Downs')
plt.ylabel('Duration in min')
plt.plot(data)