Restore the internal state of the masked array, for pickling purposes. ``state`` is typically the output of the ``__getstate__`` output, and is a 5-tuple: - class name - a tuple giving the shape of the data - a typecode for the data - a binary string
(self, state)
| 6291 | return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) |
| 6292 | |
| 6293 | def __setstate__(self, state): |
| 6294 | """Restore the internal state of the masked array, for |
| 6295 | pickling purposes. ``state`` is typically the output of the |
| 6296 | ``__getstate__`` output, and is a 5-tuple: |
| 6297 | |
| 6298 | - class name |
| 6299 | - a tuple giving the shape of the data |
| 6300 | - a typecode for the data |
| 6301 | - a binary string for the data |
| 6302 | - a binary string for the mask. |
| 6303 | |
| 6304 | """ |
| 6305 | (_, shp, typ, isf, raw, msk, flv) = state |
| 6306 | super().__setstate__((shp, typ, isf, raw)) |
| 6307 | self._mask.__setstate__((shp, make_mask_descr(typ), isf, msk)) |
| 6308 | self.fill_value = flv |
| 6309 | |
| 6310 | def __reduce__(self): |
| 6311 | """Return a 3-tuple for pickling a MaskedArray. |