MCPcopy Index your code
hub / github.com/numpy/numpy / tolist

Method tolist

numpy/ma/core.py:6656–6677  ·  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

6654 return asarray(self).filled(fill_value)[()]
6655
6656 def tolist(self):
6657 """
6658 Transforms the mvoid object into a tuple.
6659
6660 Masked fields are replaced by None.
6661
6662 Returns
6663 -------
6664 returned_tuple
6665 Tuple of fields
6666 """
6667 _mask = self._mask
6668 if _mask is nomask:
6669 return self._data.tolist()
6670 result = []
6671 for (d, m) in zip(self._data, self._mask):
6672 if m:
6673 result.append(None)
6674 else:
6675 # .item() makes sure we return a standard Python object
6676 result.append(d.item())
6677 return tuple(result)
6678
6679
6680##############################################################################

Callers 15

testCeilNonArrayMethod · 0.45
arrayFunction · 0.45
fromrecordsFunction · 0.45
_to_bytes_or_str_arrayFunction · 0.45
test_sortFunction · 0.45
test_returnMethod · 0.45
test_rec_iterateMethod · 0.45
test_recarray_tolistMethod · 0.45
test_rsplitMethod · 0.45

Calls 1

itemMethod · 0.80

Tested by 15

testCeilNonArrayMethod · 0.36
test_sortFunction · 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