MCPcopy
hub / github.com/numpy/numpy / test_prod

Method test_prod

numpy/matrixlib/tests/test_defmatrix.py:83–94  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

81 assert_equal(sumall, np.sum(M))
82
83 def test_prod(self):
84 x = matrix([[1, 2, 3], [4, 5, 6]])
85 assert_equal(x.prod(), 720)
86 assert_equal(x.prod(0), matrix([[4, 10, 18]]))
87 assert_equal(x.prod(1), matrix([[6], [120]]))
88
89 assert_equal(np.prod(x), 720)
90 assert_equal(np.prod(x, axis=0), matrix([[4, 10, 18]]))
91 assert_equal(np.prod(x, axis=1), matrix([[6], [120]]))
92
93 y = matrix([0, 1, 3])
94 assert_(y.prod() == 0)
95
96 def test_max(self):
97 x = matrix([[1, 2, 3], [4, 5, 6]])

Callers

nothing calls this directly

Calls 4

matrixClass · 0.90
assert_equalFunction · 0.90
assert_Function · 0.90
prodMethod · 0.45

Tested by

no test coverage detected