[ Web Proxy ]
URL:
Viewing: https://numpy.org/doc/stable/reference/generated/../generated/numpy.result_type.html [Back]  [Original]

numpy.result_type — NumPy v2.5 Manual
Back to top
Search the docs ...:

numpy.result_type#

numpy.result_type(*arrays_and_dtypes)#

Returns the type that results from applying the NumPy type promotion rules to the arguments.

Parameters:
arrays_and_dtypeslist of arrays and dtypes

The operands of some operation whose result type is needed.

Returns:
outdtype

The result type.

Examples

Try it in your browser!
>>> import numpy as np
>>> np.result_type(3, np.arange(7, dtype=np.int8))
dtype('int8')
>>> np.result_type(np.int32, np.complex64)
dtype('complex128')
>>> np.result_type(3.0, -2)
dtype('float64')

Web Proxy Viewer  |  New URL  |  Original Page