Restore the internal state of the masked array. This is for pickling. ``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 bina
(self, state)
| 455 | return state |
| 456 | |
| 457 | def __setstate__(self, state): |
| 458 | """ |
| 459 | Restore the internal state of the masked array. |
| 460 | |
| 461 | This is for pickling. ``state`` is typically the output of the |
| 462 | ``__getstate__`` output, and is a 5-tuple: |
| 463 | |
| 464 | - class name |
| 465 | - a tuple giving the shape of the data |
| 466 | - a typecode for the data |
| 467 | - a binary string for the data |
| 468 | - a binary string for the mask. |
| 469 | |
| 470 | """ |
| 471 | (ver, shp, typ, isf, raw, msk, flv) = state |
| 472 | ndarray.__setstate__(self, (shp, typ, isf, raw)) |
| 473 | mdtype = dtype([(k, bool_) for (k, _) in self.dtype.descr]) |
| 474 | self.__dict__['_mask'].__setstate__((shp, mdtype, isf, msk)) |
| 475 | self.fill_value = flv |
| 476 | |
| 477 | def __reduce__(self): |
| 478 | """ |