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

Method test_unique_onlist

numpy/ma/tests/test_extras.py:1468–1475  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1466class TestArraySetOps:
1467
1468 def test_unique_onlist(self):
1469 # Test unique on list
1470 data = [1, 1, 1, 2, 2, 3]
1471 test = unique(data, return_index=True, return_inverse=True)
1472 assert_(isinstance(test[0], MaskedArray))
1473 assert_equal(test[0], masked_array([1, 2, 3], mask=[0, 0, 0]))
1474 assert_equal(test[1], [0, 3, 5])
1475 assert_equal(test[2], [0, 0, 0, 1, 1, 2])
1476
1477 def test_unique_onmaskedarray(self):
1478 # Test unique on masked data w/use_mask=True

Callers

nothing calls this directly

Calls 3

uniqueFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.50

Tested by

no test coverage detected