NumPy

Previous topic

numpy.ma.MaskedArray.__str__

Next topic

numpy.ma.MaskedArray.iscontiguous

This is documentation for an old release of NumPy (version 1.19). Read this page in the documentation of the latest stable release (version 2.2).

numpy.ma.MaskedArray.ids

method

MaskedArray.ids(self)[source]

Return the addresses of the data and mask areas.

Parameters
None

Examples

>>>
>>> x = np.ma.array([1, 2, 3], mask=[0, 1, 1])
>>> x.ids()
(166670640, 166659832) # may vary

If the array has no mask, the address of nomask is returned. This address is typically not close to the data in memory:

>>>
>>> x = np.ma.array([1, 2, 3])
>>> x.ids()
(166691080, 3083169284) # may vary