MCPcopy Index your code
hub / github.com/RustPython/RustPython / ndarray_from_structure

Function ndarray_from_structure

Lib/test/test_buffer.py:633–637  ·  view source on GitHub ↗

Return ndarray from the tuple returned by rand_structure()

(items, fmt, t, flags=0)

Source from the content-addressed store, hash-verified

631 return gen_items(memlen//itemsize, '#'+fmt, 'numpy')
632
633def ndarray_from_structure(items, fmt, t, flags=0):
634 """Return ndarray from the tuple returned by rand_structure()"""
635 memlen, itemsize, ndim, shape, strides, offset = t
636 return ndarray(items, shape=shape, strides=strides, format=fmt,
637 offset=offset, flags=ND_WRITABLE|flags)
638
639def numpy_array_from_structure(items, fmt, t):
640 """Return numpy_array from the tuple returned by rand_structure()"""

Calls

no outgoing calls

Tested by

no test coverage detected