Good afternoon, I'm learning python and I am making some graphics with a file with data, dates and times My first goal was to graphic the data vs time, Magnitude vs Fulltime, only Saturday and Sundays (d2 and w) vs time, and only the 11pm to 12md of Business Day (Hour and d4) vs time. And with all the happiness I did it. Now my second goal is to make another curve in ax[0,1].plot(w) and ax[1,1].plot(d4), but now with the accumulation of the data in w and d4. I know how to do another curve an existing graph, but i don't know how to plot the accumulation of the data in a variable like w and d4. How can I do it? Also if you see some things in Spanish, is because I live in Costa Rica.
fecha, hora, mag = np.loadtxt("Cat2019.event.cat", usecols=(0, 1, 5), unpack=True,
dtype="str")
mag = mag.astype(np.float)
Fulltime=[]
for i,f in enumerate(fecha):
temp = f'{f}T{hora[i]}'
temp2 = datetime.datetime.strptime(temp, '%Y%m%dT%H%M%S%f')
Fulltime.append(temp2)
ts = pd.Series(np.random.randint(0, 50, len(Fulltime)), index=Fulltime)
#Every Day
d = ts.resample('D').count()
#Now for Saturdays and Sundays
d2 = ts.resample('D').count()
w = d2[d2.index.dayofweek.isin([5,6])]
#Now for 23pm to 12md only in Business Days
Hour = ts.between_time("23:00", "12:00")
d4= Hour.resample("B").count()
Graphics
ax[0,0].plot(d)
ax[1,0].scatter(Fulltime, mag, s=1.0)
ax[0,1].plot(w)
ax[1,1].plot(d4)
Thank you