Return copy of structured array with padding between fields removed. Parameters ---------- ary : ndarray Structured array from which to remove padding bytes Returns ------- ary_copy : ndarray Copy of ary with padding bytes removed
(ary)
| 416 | raise ValueError(f"unsupported order value: {order}") |
| 417 | |
| 418 | def _copy_fields(ary): |
| 419 | """Return copy of structured array with padding between fields removed. |
| 420 | |
| 421 | Parameters |
| 422 | ---------- |
| 423 | ary : ndarray |
| 424 | Structured array from which to remove padding bytes |
| 425 | |
| 426 | Returns |
| 427 | ------- |
| 428 | ary_copy : ndarray |
| 429 | Copy of ary with padding bytes removed |
| 430 | """ |
| 431 | dt = ary.dtype |
| 432 | copy_dtype = {'names': dt.names, |
| 433 | 'formats': [dt.fields[name][0] for name in dt.names]} |
| 434 | return array(ary, dtype=copy_dtype, copy=True) |
| 435 | |
| 436 | def _promote_fields(dt1, dt2): |
| 437 | """ Perform type promotion for two structured dtypes. |