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

Method test_wmasked_arrays

numpy/lib/tests/test_recfunctions.py:523–534  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

521 assert_equal(test, control)
522
523 def test_wmasked_arrays(self):
524 # Test merge_arrays masked arrays
525 (_, x, _, _) = self.data
526 mx = ma.array([1, 2, 3], mask=[1, 0, 0])
527 test = merge_arrays((x, mx), usemask=True)
528 control = ma.array([(1, 1), (2, 2), (-1, 3)],
529 mask=[(0, 1), (0, 0), (1, 0)],
530 dtype=[('f0', int), ('f1', int)])
531 assert_equal(test, control)
532 test = merge_arrays((x, mx), usemask=True, asrecarray=True)
533 assert_equal(test, control)
534 assert_(isinstance(test, MaskedRecords))
535
536 def test_w_singlefield(self):
537 # Test single field

Callers

nothing calls this directly

Calls 3

merge_arraysFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.90

Tested by

no test coverage detected