MCPcopy Index your code
hub / github.com/numpy/numpy / __getitem__

Method __getitem__

numpy/ma/core.py:2721–2732  ·  view source on GitHub ↗
(self, indx)

Source from the content-addressed store, hash-verified

2719 return self
2720
2721 def __getitem__(self, indx):
2722 result = self.dataiter.__getitem__(indx).view(type(self.ma))
2723 if self.maskiter is not None:
2724 _mask = self.maskiter.__getitem__(indx)
2725 if isinstance(_mask, ndarray):
2726 # set shape to match that of data; this is needed for matrices
2727 result._mask = _mask.reshape(result.shape)
2728 elif isinstance(_mask, np.void):
2729 return mvoid(result, mask=_mask, hardmask=self.ma._hardmask)
2730 elif _mask: # Just a scalar, masked
2731 return masked
2732 return result
2733
2734 # This won't work if ravel makes a copy
2735 def __setitem__(self, index, value):

Callers

nothing calls this directly

Calls 4

mvoidClass · 0.85
reshapeMethod · 0.80
viewMethod · 0.45
__getitem__Method · 0.45

Tested by

no test coverage detected