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

Method test_append_on_nested

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

append_fieldsFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected