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

Function test_average_matrix

numpy/matrixlib/tests/test_interaction.py:231–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229
230
231def test_average_matrix():
232 # 2018-04-29: moved here from core.tests.test_function_base.
233 y = np.matrix(np.random.rand(5, 5))
234 assert_array_equal(y.mean(0), np.average(y, 0))
235
236 a = np.matrix([[1, 2], [3, 4]])
237 w = np.matrix([[1, 2], [3, 4]])
238
239 r = np.average(a, axis=0, weights=w)
240 assert_equal(type(r), np.matrix)
241 assert_equal(r, [[2.5, 10.0/3]])
242
243
244def test_trapz_matrix():

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
assert_equalFunction · 0.90
meanMethod · 0.45

Tested by

no test coverage detected