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

Method test_tolist

numpy/ma/tests/test_mrecords.py:312–323  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

310 dtype='|S8'))
311
312 def test_tolist(self):
313 # Test tolist.
314 _a = ma.array([1, 2, 3], mask=[0, 0, 1], dtype=int)
315 _b = ma.array([1.1, 2.2, 3.3], mask=[0, 0, 1], dtype=float)
316 _c = ma.array(['one', 'two', 'three'], mask=[1, 0, 0], dtype='|S8')
317 ddtype = [('a', int), ('b', float), ('c', '|S8')]
318 mrec = fromarrays([_a, _b, _c], dtype=ddtype,
319 fill_value=(99999, 99999., 'N/A'))
320
321 assert_equal(mrec.tolist(),
322 [(1, 1.1, None), (2, 2.2, b'two'),
323 (None, None, b'three')])
324
325 def test_withnames(self):
326 # Test the creation w/ format and names

Callers

nothing calls this directly

Calls 3

fromarraysFunction · 0.90
assert_equalFunction · 0.90
tolistMethod · 0.45

Tested by

no test coverage detected