(self)
| 2199 | class TestUnique: |
| 2200 | |
| 2201 | def test_simple(self): |
| 2202 | x = np.array([4, 3, 2, 1, 1, 2, 3, 4, 0]) |
| 2203 | assert_(np.all(unique(x) == [0, 1, 2, 3, 4])) |
| 2204 | assert_(unique(np.array([1, 1, 1, 1, 1])) == np.array([1])) |
| 2205 | x = ['widget', 'ham', 'foo', 'bar', 'foo', 'ham'] |
| 2206 | assert_(np.all(unique(x) == ['bar', 'foo', 'ham', 'widget'])) |
| 2207 | x = np.array([5 + 6j, 1 + 1j, 1 + 10j, 10, 5 + 6j]) |
| 2208 | assert_(np.all(unique(x) == [1 + 1j, 1 + 10j, 5 + 6j, 10])) |
| 2209 | |
| 2210 | |
| 2211 | class TestCheckFinite: |