This is a continuation of Visualize the export data of Piyolog. Add the forward average to the graph generated last time.
get_array_average
def get_array_average(array, span):
ave = 0
ret_array = []
for index, item in enumerate(array):
if index <= len(array) - span:
for i in range(span):
ave += array[index + i]
ret_array.append(round(ave / span, 1))
ave = 0
return ret_array
This time, we are calculating the forward average for 10 days. You can see that the sleep time is decreasing as you grow up.
Recommended Posts