MCPcopy Index your code
hub / github.com/numpy/numpy / test_unique_onlist

Method test_unique_onlist

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

Source from the content-addressed store, hash-verified

1510class TestArraySetOps:
1511
1512 def test_unique_onlist(self):
1513 # Test unique on list
1514 data = [1, 1, 1, 2, 2, 3]
1515 test = unique(data, return_index=True, return_inverse=True)
1516 assert_(isinstance(test[0], MaskedArray))
1517 assert_equal(test[0], masked_array([1, 2, 3], mask=[0, 0, 0]))
1518 assert_equal(test[1], [0, 3, 5])
1519 assert_equal(test[2], [0, 0, 0, 1, 1, 2])
1520
1521 def test_unique_onmaskedarray(self):
1522 # 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.85

Tested by

no test coverage detected