MCPcopy Create free account
hub / github.com/numpy/numpy / test_mask_indices

Function test_mask_indices

numpy/lib/tests/test_twodim_base.py:389–396  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

387
388
389def test_mask_indices():
390 # simple test without offset
391 iu = mask_indices(3, np.triu)
392 a = np.arange(9).reshape(3, 3)
393 assert_array_equal(a[iu], array([0, 1, 2, 4, 5, 8]))
394 # Now with an offset
395 iu1 = mask_indices(3, np.triu, 1)
396 assert_array_equal(a[iu1], array([1, 2, 5]))
397
398
399def test_tril_indices():

Callers

nothing calls this directly

Calls 4

mask_indicesFunction · 0.90
assert_array_equalFunction · 0.90
arrayFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected