numpy.common_type

numpy.common_type(*arrays)

Return the inexact scalar type which is most common in a list of arrays.

The return type will always be an inexact scalar type, even if all the arrays are integer arrays

Parameters:

array1, array2, ... : ndarray

Input arrays.

Returns:

out : data type code

Data type code.

See also

dtype

Examples

>>> np.common_type(np.arange(4), np.array([45,6]), np.array([45.0, 6.0]))
<type 'numpy.float64'>

Previous topic

numpy.can_cast

Next topic

numpy.obj2sctype

This Page

Quick search