plotting.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:ml_capstone 作者: drscott173 项目源码 文件源码
def moving_average_2d(self, data, window):
        """Moving average on two-dimensional data.
        """
        # Makes sure that the window function is normalized.
        window /= window.sum()
        # Makes sure data array is a numpy array or masked array.
        if type(data).__name__ not in ['ndarray', 'MaskedArray']:
            data = numpy.asarray(data)

        # The output array has the same dimensions as the input data 
        # (mode='same') and symmetrical boundary conditions are assumed
        # (boundary='symm').
        return convolve2d(data, window, mode='same', boundary='symm')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号