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

Method test_basic

numpy/lib/tests/test_twodim_base.py:534–547  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

532
533class TestVander:
534 def test_basic(self):
535 c = np.array([0, 1, -2, 3])
536 v = vander(c)
537 powers = np.array([[0, 0, 0, 0, 1],
538 [1, 1, 1, 1, 1],
539 [16, -8, 4, -2, 1],
540 [81, 27, 9, 3, 1]])
541 # Check default value of N:
542 assert_array_equal(v, powers[:, 1:])
543 # Check a range of N values, including 0 and 5 (greater than default)
544 m = powers.shape[1]
545 for n in range(6):
546 v = vander(c, N=n)
547 assert_array_equal(v, powers[:, m - n:m])
548
549 def test_dtypes(self):
550 c = array([11, -12, 13], dtype=np.int8)

Callers

nothing calls this directly

Calls 2

vanderFunction · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected