main.py 文件源码

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

项目:house-price-map 作者: andyljones 项目源码 文件源码
def smooth(arr, sigma=5):
    filled = arr.copy()
    nans = sp.isnan(arr)    

    filled[nans] = 0
    smoothed = sp.ndimage.gaussian_filter(filled, sigma=sigma, truncate=10)  
    missing_coefs = sp.ndimage.gaussian_filter((~nans).astype(float), sigma=sigma, truncate=10)

    corrected = smoothed/missing_coefs

    return corrected
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号