Answer the question
In order to leave comments, you need to log in
How to write a moving average implementation for a time series?
There is a set of dates in datetime format like: datetime.datetime(2017, 12, 8, 18, 0) .
There is some value for each date.
There are many dates/values.
I wrapped everything in a dataframe, tried to implement the simplest moving average method from Habr , or rather, this one:
def moving_average(series, n):
return np.average(series[-n:])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question