bundles / numpy latest / numpy / lib / format / dtype_to_descr
function
numpy.lib.format:dtype_to_descr
source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_format_impl.py :250
Signature
def dtype_to_descr ( dtype ) Summary
Get a serializable descriptor from the dtype.
Extended Summary
The .descr attribute of a dtype object cannot be round-tripped through the dtype() constructor. Simple types, like dtype('float32'), have a descr which looks like a record array with one field with '' as a name. The dtype() constructor interprets this as a request to give a default name. Instead, we construct descriptor that can be passed to dtype().
Parameters
dtype: dtypeThe dtype of the array that will be written to disk.
Returns
descr: objectAn object that can be passed to numpy.dtype() in order to replicate the input dtype.
Aliases
-
numpy.lib._format_impl.dtype_to_descr