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

Method view

numpy/ma/mrecords.py:351–366  ·  view source on GitHub ↗

Returns a view of the mrecarray.

(self, dtype=None, type=None)

Source from the content-addressed store, hash-verified

349 return str("\n".join(reprstr))
350
351 def view(self, dtype=None, type=None):
352 """
353 Returns a view of the mrecarray.
354
355 """
356 # If the new dtype has no fields, we need to revert to MaskedArray,
357 # but keep the possibility of subclasses (eg, TimeSeriesRecords).
358 # So we'll force a type set to the first parent.
359 if (type is None
360 and dtype is not None
361 and not (isinstance(dtype, builtins.type)
362 and issubclass(dtype, np.ndarray))
363 and (dtype := np.dtype(dtype)).fields is None):
364 type = self.__class__.__bases__[0]
365
366 return super().view(*[a for a in (dtype, type) if a is not None])
367
368 def harden_mask(self):
369 """

Callers 9

__array_finalize__Method · 0.45
_dataMethod · 0.45
__getattribute__Method · 0.45
__getitem__Method · 0.45
copyMethod · 0.45
_mrreconstructFunction · 0.45
fromarraysFunction · 0.45
fromrecordsFunction · 0.45
addfieldFunction · 0.45

Calls 1

dtypeMethod · 0.45

Tested by

no test coverage detected