numpy.can_cast

numpy.can_cast(from=d1, to=d2)

Returns True if cast between data types can occur without losing precision.

Parameters:

from: data type code :

Data type code to cast from.

to: data type code :

Data type code to cast to.

Returns:

out : bool

True if cast can occur without losing precision.

Previous topic

Data type routines

Next topic

numpy.common_type

This Page

Quick search