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

Method inspect

numpy/lib/tests/test_recfunctions.py:321–325  ·  view source on GitHub ↗
(dt, dtype=None)

Source from the content-addressed store, hash-verified

319 return np.dtype([('x{}'.format(i), dt) for i, dt in enumerate(dts)])
320
321 def inspect(dt, dtype=None):
322 arr = np.zeros((), dt)
323 ret = structured_to_unstructured(arr, dtype=dtype)
324 backarr = unstructured_to_structured(ret, dt)
325 return ret.shape, ret.dtype, backarr.dtype
326
327 dt = structured(subarray(structured(np.int32, np.int32), 3))
328 assert_equal(inspect(dt), ((6,), np.int32, dt))

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected