MCPcopy
hub / github.com/numpy/numpy / test_ambiguous_fill

Method test_ambiguous_fill

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

Source from the content-addressed store, hash-verified

1232 assert_equal(np.ma.median(a, (0, 2)), b)
1233
1234 def test_ambiguous_fill(self):
1235 # 255 is max value, used as filler for sort
1236 a = np.array([[3, 3, 255], [3, 3, 255]], dtype=np.uint8)
1237 a = np.ma.masked_array(a, mask=a == 3)
1238 assert_array_equal(np.ma.median(a, axis=1), 255)
1239 assert_array_equal(np.ma.median(a, axis=1).mask, False)
1240 assert_array_equal(np.ma.median(a, axis=0), a[0])
1241 assert_array_equal(np.ma.median(a), 255)
1242
1243 def test_special(self):
1244 for inf in [np.inf, -np.inf]:

Callers

nothing calls this directly

Calls 1

assert_array_equalFunction · 0.90

Tested by

no test coverage detected