The Python Oracle

Moving average or running mean

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Sunrise at the Stream

--

Chapters
00:00 Question
00:20 Accepted answer (Score 29)
00:43 Answer 2 (Score 359)
02:48 Answer 3 (Score 182)
04:49 Answer 4 (Score 98)
06:20 Thank you

--

Full question
https://stackoverflow.com/questions/1372...

Answer 1 links:
[uniform_filter1d]: https://stackoverflow.com/a/43200476/675...
[np.convolve]: http://docs.scipy.org/doc/numpy/referenc...
[convolution]: https://en.wikipedia.org/wiki/Convolutio...

Answer 2 links:
[the comments pointed out this floating point error issue here but i am making it more obvious here in the answer.]: https://stackoverflow.com/questions/1372...
[np.longdouble]: https://docs.scipy.org/doc/numpy-1.13.0/...
[the convolve solution]: https://stackoverflow.com/a/22621523/520...
[the uniform_filter1d solution]: https://stackoverflow.com/a/43200476/520...

Answer 3 links:
[pandas.Series.rolling]: https://pandas.pydata.org/docs/reference...
[pandas]: http://pandas.pydata.org/
[rolling_mean]: http://pandas.pydata.org/pandas-docs/sta...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #numpy #scipy #movingaverage

#avk47