Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python scipy moving average

# credit to the Stack Overflow user in the source link
# x is the numpy (np) array you want to moving-average
# w is the actual length of the window of the moving average (an integer)

np.convolve(x, np.ones(w), 'valid') / w
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #scipy #moving #average
ADD COMMENT
Topic
Name
3+9 =