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

Method test_simple

numpy/lib/tests/test_function_base.py:2201–2208  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2199class 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
2211class TestCheckFinite:

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
uniqueFunction · 0.90
allMethod · 0.45

Tested by

no test coverage detected