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

Method __getstate__

numpy/ma/core.py:6284–6291  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

6282
6283 # Pickling
6284 def __getstate__(self):
6285 """Return the internal state of the masked array, for pickling
6286 purposes.
6287
6288 """
6289 cf = 'CF'[self.flags.fnc]
6290 data_state = super().__reduce__()[2]
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

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