📜  python scipy 移动平均线 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:57.133000             🧑  作者: Mango

代码示例1
# 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