MCPcopy Create free account
hub / github.com/numpy/numpy / __setstate__

Method __setstate__

numpy/ma/mrecords.py:457–475  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 1

dtypeFunction · 0.90

Tested by

no test coverage detected