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

Function _copy_fields

numpy/core/_internal.py:418–434  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

416 raise ValueError(f"unsupported order value: {order}")
417
418def _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
436def _promote_fields(dt1, dt2):
437 """ Perform type promotion for two structured dtypes.

Callers

nothing calls this directly

Calls 1

arrayFunction · 0.70

Tested by

no test coverage detected