ImageFile.compressed

ImageFile.compressed()

Return all the non-masked data as a 1-D array.

datandarray

A new ndarray holding the non-masked data is returned.

The result is not a MaskedArray!

>>> x = np.ma.array(np.arange(5), mask=[0]*2 + [1]*3)
>>> x.compressed()
array([0, 1])
>>> type(x.compressed())
<class 'numpy.ndarray'>