(self)
| 2485 | class TestUnique: |
| 2486 | |
| 2487 | def test_simple(self): |
| 2488 | x = np.array([4, 3, 2, 1, 1, 2, 3, 4, 0]) |
| 2489 | assert_(np.all(unique(x) == [0, 1, 2, 3, 4])) |
| 2490 | assert_(unique(np.array([1, 1, 1, 1, 1])) == np.array([1])) |
| 2491 | x = ['widget', 'ham', 'foo', 'bar', 'foo', 'ham'] |
| 2492 | assert_(np.all(unique(x) == ['bar', 'foo', 'ham', 'widget'])) |
| 2493 | x = np.array([5 + 6j, 1 + 1j, 1 + 10j, 10, 5 + 6j]) |
| 2494 | assert_(np.all(unique(x) == [1 + 1j, 1 + 10j, 5 + 6j, 10])) |
| 2495 | |
| 2496 | |
| 2497 | class TestCheckFinite: |