test_dc_stat_think.py 文件源码

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

项目:dc_stat_think 作者: justinbois 项目源码 文件源码
def test_pearson_r(data):
    x, y = data
    if np.allclose(x, x[0], atol=atol, equal_nan=True) or np.allclose(y, y[0], atol=atol, equal_nan=True):
        assert np.isnan(dcst.pearson_r(x, y))
    else:
        assert np.isclose(dcst.pearson_r(x, y), original.pearson_r(x, y))
        assert np.isclose(dcst.pearson_r(x, y), np.corrcoef(x, y)[0,1])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号