Skip to main content
`Ctrl`+`K`

# numpy.__array_namespace_info__.dtypes

method

__array_namespace_info__.dtypes(*, device=None, kind=None)

  The array API data types supported by NumPy.

  Note that this function only returns data types that are defined by the array API.

  Parameters:
    device str, optional

      The device to get the data types for. For NumPy, only `'cpu'` is allowed.

    kind str or tuple of str, optional

      The kind of data types to return. If `None`, all data types are returned. If a string, only data types of that kind are returned. If a tuple, a dictionary containing the union of the given kinds is returned. The following kinds are supported:

      - `'bool'`: boolean data types (i.e., `bool`).

      - `'signed integer'`: signed integer data types (i.e., `int8`, `int16`, `int32`, `int64`).

      - `'unsigned integer'`: unsigned integer data types (i.e., `uint8`, `uint16`, `uint32`, `uint64`).

      - `'integral'`: integer data types. Shorthand for `('signed integer', 'unsigned integer')`.

      - `'real floating'`: real-valued floating-point data types (i.e., `float32`, `float64`).

      - `'complex floating'`: complex floating-point data types (i.e., `complex64`, `complex128`).

      - `'numeric'`: numeric data types. Shorthand for `('integral', 'real floating', 'complex floating')`.

  Returns:
    dtypes dict

      A dictionary mapping the names of data types to the corresponding NumPy data types.

  See also

  `__array_namespace_info__.capabilities`
  `__array_namespace_info__.default_device`
  `__array_namespace_info__.default_dtypes`
  `__array_namespace_info__.devices`

  Examples

      >>> info = np.__array_namespace_info__()
      >>> info.dtypes(kind='signed integer')
      {'int8': numpy.int8,
       'int16': numpy.int16,
       'int32': numpy.int32,
       'int64': numpy.int64}