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

Method test_testAverage4

numpy/ma/tests/test_extras.py:245–252  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

243 assert_equal(a2dma, [1.5, 4.0])
244
245 def test_testAverage4(self):
246 # Test that `keepdims` works with average
247 x = np.array([2, 3, 4]).reshape(3, 1)
248 b = np.ma.array(x, mask=[[False], [False], [True]])
249 w = np.array([4, 5, 6]).reshape(3, 1)
250 actual = average(b, weights=w, axis=1, keepdims=True)
251 desired = masked_array([[2.], [3.], [4.]], [[False], [False], [True]])
252 assert_equal(actual, desired)
253
254 def test_onintegers_with_mask(self):
255 # Test average on integers with mask

Callers

nothing calls this directly

Calls 3

averageFunction · 0.90
assert_equalFunction · 0.90
reshapeMethod · 0.80

Tested by

no test coverage detected