def gaussian(y, window_size=3, sigma=2):
"""
Apply a gaussian filter to smooth the input vector
Parameters
==========
y : array
The input array
window_size : int
An odd integer describing the size of the filter.
sigma : float
The numver of standard deviation
"""
filt = signal.gaussian(window_size, sigma)
return Series(signal.convolve(y, filt, mode='same'), index=y.index)
评论列表
文章目录