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)
| 6490 | return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) |
| 6491 | |
| 6492 | def __setstate__(self, state): |
| 6493 | """Restore the internal state of the masked array, for |
| 6494 | pickling purposes. ``state`` is typically the output of the |
| 6495 | ``__getstate__`` output, and is a 5-tuple: |
| 6496 | |
| 6497 | - class name |
| 6498 | - a tuple giving the shape of the data |
| 6499 | - a typecode for the data |
| 6500 | - a binary string for the data |
| 6501 | - a binary string for the mask. |
| 6502 | |
| 6503 | """ |
| 6504 | (_, shp, typ, isf, raw, msk, flv) = state |
| 6505 | super().__setstate__((shp, typ, isf, raw)) |
| 6506 | self._mask.__setstate__((shp, make_mask_descr(typ), isf, msk)) |
| 6507 | self.fill_value = flv |
| 6508 | |
| 6509 | def __reduce__(self): |
| 6510 | """Return a 3-tuple for pickling a MaskedArray. |