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

Method test_basic

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

Source from the content-addressed store, hash-verified

509
510class TestVander:
511 def test_basic(self):
512 c = np.array([0, 1, -2, 3])
513 v = vander(c)
514 powers = np.array([[0, 0, 0, 0, 1],
515 [1, 1, 1, 1, 1],
516 [16, -8, 4, -2, 1],
517 [81, 27, 9, 3, 1]])
518 # Check default value of N:
519 assert_array_equal(v, powers[:, 1:])
520 # Check a range of N values, including 0 and 5 (greater than default)
521 m = powers.shape[1]
522 for n in range(6):
523 v = vander(c, N=n)
524 assert_array_equal(v, powers[:, m-n:m])
525
526 def test_dtypes(self):
527 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