pyinterp.TemporalAxis.safe_cast

pyinterp.TemporalAxis.safe_cast#

TemporalAxis.safe_cast(self: pyinterp.core.TemporalAxis, values: numpy.ndarray) numpy.ndarray#

Convert values to the same unit as the time axis.

Parameters:

values – Values to convert.

Returns:

Values converted.

Raises:

UserWarning – If the implicit conversion of the supplied values to the resolution of the axis truncates the values (e.g. converting microseconds to seconds).