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

Method test_simple

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

Source from the content-addressed store, hash-verified

2485class 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
2497class TestCheckFinite:

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
uniqueFunction · 0.90
allMethod · 0.45

Tested by

no test coverage detected