test_twodim_base.py 文件源码

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

项目:krpcScripts 作者: jwvanderbeck 项目源码 文件源码
def test_mask_indices():
    # simple test without offset
    iu = mask_indices(3, np.triu)
    a = np.arange(9).reshape(3, 3)
    yield (assert_array_equal, a[iu], array([0, 1, 2, 4, 5, 8]))
    # Now with an offset
    iu1 = mask_indices(3, np.triu, 1)
    yield (assert_array_equal, a[iu1], array([1, 2, 5]))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号