bundles / numpy 2.4.3 / numpy / common_type
_ArrayFunctionDispatcher
numpy:common_type
Signature
def common_type ( * arrays ) Summary
Return a scalar type which is common to the input arrays.
Extended Summary
The return type will always be an inexact (i.e. floating point) scalar type, even if all the arrays are integer arrays. If one of the inputs is an integer array, the minimum precision type that is returned is a 64-bit floating point dtype.
All input arrays except int64 and uint64 can be safely cast to the returned dtype without loss of information.
Parameters
array1, array2, ...: ndarraysInput arrays.
Returns
out: data type codeData type code.
Examples
np.common_type(np.arange(2, dtype=np.float32)) np.common_type(np.arange(2, dtype=np.float32), np.arange(2)) np.common_type(np.arange(4), np.array([45, 6.j]), np.array([45.0]))✓
See also
- dtype
- mintypecode
Aliases
-
numpy.common_type