# numpy.lib.format.dtype_to_descr

lib.format.dtype_to_descr(dtype)

  Get a serializable descriptor from the dtype.

  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 dtype

      The dtype of the array that will be written to disk.

  Returns
    descr object

      An object that can be passed to numpy.dtype() in order to replicate the input dtype.

previous

numpy.lib.format.descr_to_dtype

next

numpy.lib.format.header_data_from_array_1_0