tools.py 文件源码

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

项目:spikes 作者: mozilla 项目源码 文件源码
def __get_pd_median(data, c=1.):
    """Get the median and the mad of data

    Args:
        data (numpy.ndarray): the data

    Returns:
        float, float: the median and the mad
    """
    p = np.nanmedian(data)
    d = np.nanmedian(np.abs(data - p)) / c  # d is the MAD

    return p, d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号