MCPcopy Index your code
hub / github.com/numpy/numpy / test_empty

Method test_empty

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

Source from the content-addressed store, hash-verified

1284 ([np.nan] * i) + [inf] * j)
1285
1286 def test_empty(self):
1287 # empty arrays
1288 a = np.ma.masked_array(np.array([], dtype=float))
1289 with pytest.warns(RuntimeWarning):
1290 assert_array_equal(np.ma.median(a), np.nan)
1291
1292 # multiple dimensions
1293 a = np.ma.masked_array(np.array([], dtype=float, ndmin=3))
1294 # no axis
1295 with pytest.warns(RuntimeWarning):
1296 assert_array_equal(np.ma.median(a), np.nan)
1297
1298 # axis 0 and 1
1299 b = np.ma.masked_array(np.array([], dtype=float, ndmin=2))
1300 assert_equal(np.ma.median(a, axis=0), b)
1301 assert_equal(np.ma.median(a, axis=1), b)
1302
1303 # axis 2
1304 b = np.ma.masked_array(np.array(np.nan, dtype=float, ndmin=2))
1305 with pytest.warns(RuntimeWarning):
1306 assert_equal(np.ma.median(a, axis=2), b)
1307
1308 def test_object(self):
1309 o = np.ma.masked_array(np.arange(7.))

Callers

nothing calls this directly

Calls 2

assert_array_equalFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected