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

Method test_append_on_nested

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

Source from the content-addressed store, hash-verified

613 assert_equal(test, control)
614
615 def test_append_on_nested(self):
616 # Test append_fields on nested fields
617 w = self._create_arrays()[0]
618 test = append_fields(w, 'C', data=[10, 20, 30])
619 control = ma.array([(1, (2, 3.0), 10),
620 (4, (5, 6.0), 20),
621 (-1, (-1, -1.), 30)],
622 mask=[(
623 0, (0, 0), 0), (0, (0, 0), 0), (1, (1, 1), 0)],
624 dtype=[('a', int),
625 ('b', [('ba', float), ('bb', int)]),
626 ('C', int)],)
627 assert_equal(test, control)
628
629
630class TestStackArrays:

Callers

nothing calls this directly

Calls 3

_create_arraysMethod · 0.95
append_fieldsFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected