(self)
| 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 |
| 1523 | data = masked_array([1, 1, 1, 2, 2, 3], mask=[0, 0, 1, 0, 1, 0]) |
| 1524 | test = unique(data, return_index=True, return_inverse=True) |
| 1525 | assert_equal(test[0], masked_array([1, 2, 3, -1], mask=[0, 0, 0, 1])) |
| 1526 | assert_equal(test[1], [0, 3, 5, 2]) |
| 1527 | assert_equal(test[2], [0, 0, 3, 1, 3, 2]) |
| 1528 | # |
| 1529 | data.fill_value = 3 |
| 1530 | data = masked_array(data=[1, 1, 1, 2, 2, 3], |
| 1531 | mask=[0, 0, 1, 0, 1, 0], fill_value=3) |
| 1532 | test = unique(data, return_index=True, return_inverse=True) |
| 1533 | assert_equal(test[0], masked_array([1, 2, 3, -1], mask=[0, 0, 0, 1])) |
| 1534 | assert_equal(test[1], [0, 3, 5, 2]) |
| 1535 | assert_equal(test[2], [0, 0, 3, 1, 3, 2]) |
| 1536 | |
| 1537 | def test_unique_allmasked(self): |
| 1538 | # Test all masked |
nothing calls this directly
no test coverage detected