numpy.__array_namespace_info__.default_dtypes#

method

__array_namespace_info__.default_dtypes(*, device=None)[source]#

The default data types used for new NumPy arrays.

For NumPy, this always returns the following dictionary:

  • “real floating”: numpy.float64

  • “complex floating”: numpy.complex128

  • “integral”: numpy.intp

  • “indexing”: numpy.intp

Parameters:
devicestr, optional

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

Returns:
dtypesdict

A dictionary describing the default data types used for new NumPy arrays.

Examples

>>> info = np.__array_namespace_info__()
>>> info.default_dtypes()
{'real floating': numpy.float64,
 'complex floating': numpy.complex128,
 'integral': numpy.int64,
 'indexing': numpy.int64}