Returns a view of the mrecarray.
(self, dtype=None, type=None)
| 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 | """ |
no test coverage detected