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

Function view_element_first_byte

numpy/core/tests/test_mem_overlap.py:567–573  ·  view source on GitHub ↗

Construct an array viewing the first byte of each element of `x`

(x)

Source from the content-addressed store, hash-verified

565
566
567def view_element_first_byte(x):
568 """Construct an array viewing the first byte of each element of `x`"""
569 from numpy.lib.stride_tricks import DummyArray
570 interface = dict(x.__array_interface__)
571 interface['typestr'] = '|b1'
572 interface['descr'] = [('', '|b1')]
573 return np.asarray(DummyArray(interface, x))
574
575
576def assert_copy_equivalent(operation, args, out, **kwargs):

Callers 1

checkMethod · 0.85

Calls 1

DummyArrayClass · 0.90

Tested by

no test coverage detected