MCPcopy
hub / github.com/numpy/numpy / __getstate__

Method __getstate__

numpy/ma/core.py:6483–6490  ·  view source on GitHub ↗

Return the internal state of the masked array, for pickling purposes.

(self)

Source from the content-addressed store, hash-verified

6481
6482 # Pickling
6483 def __getstate__(self):
6484 """Return the internal state of the masked array, for pickling
6485 purposes.
6486
6487 """
6488 cf = 'CF'[self.flags.fnc]
6489 data_state = super().__reduce__()[2]
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

Callers 4

__reduce__Method · 0.95
test_getstateMethod · 0.45
test_state_settingMethod · 0.45
random.pyFile · 0.45

Calls 3

getmaskarrayFunction · 0.85
__reduce__Method · 0.45
tobytesMethod · 0.45

Tested by 2

test_getstateMethod · 0.36
test_state_settingMethod · 0.36