promote_dtypes

Contents

promote_dtypes#

class saiunit.math.promote_dtypes(*args, **kwargs)#

Promote the data types of the inputs to a common type.

Parameters:

*args (array_likes) – The arrays to promote.

Returns:

promoted – These arrays have the same shape as the input arrays, with the data type of the most precise input.

Return type:

saiunit.Quantity | Array | Sequence[saiunit.Quantity | Array]

Examples

>>> import saiunit as u
>>> a = [1, 2, 3] * u.second
>>> b = [4.0, 5.0, 6.0] * u.second
>>> u.math.promote_dtypes(a, b)