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

Method tolist

numpy/ma/core.py:6456–6477  ·  view source on GitHub ↗

Transforms the mvoid object into a tuple. Masked fields are replaced by None. Returns ------- returned_tuple Tuple of fields

(self)

Source from the content-addressed store, hash-verified

6454 return asarray(self).filled(fill_value)[()]
6455
6456 def tolist(self):
6457 """
6458 Transforms the mvoid object into a tuple.
6459
6460 Masked fields are replaced by None.
6461
6462 Returns
6463 -------
6464 returned_tuple
6465 Tuple of fields
6466 """
6467 _mask = self._mask
6468 if _mask is nomask:
6469 return self._data.tolist()
6470 result = []
6471 for (d, m) in zip(self._data, self._mask):
6472 if m:
6473 result.append(None)
6474 else:
6475 # .item() makes sure we return a standard Python object
6476 result.append(d.item())
6477 return tuple(result)
6478
6479
6480##############################################################################

Callers 15

testCeilNonArrayMethod · 0.45
_to_bytes_or_str_arrayFunction · 0.45
arrayFunction · 0.45
fromrecordsFunction · 0.45
test_returnMethod · 0.45
test_rec_iterateMethod · 0.45
test_recarray_tolistMethod · 0.45
test_rsplitMethod · 0.45
test_splitMethod · 0.45
test_numeric_to_timesMethod · 0.45
test_string_comparisonsFunction · 0.45

Calls 1

itemMethod · 0.80

Tested by 15

testCeilNonArrayMethod · 0.36
test_returnMethod · 0.36
test_rec_iterateMethod · 0.36
test_recarray_tolistMethod · 0.36
test_rsplitMethod · 0.36
test_splitMethod · 0.36
test_numeric_to_timesMethod · 0.36
test_string_comparisonsFunction · 0.36