Skip to main content

sub_datetime

Function sub_datetime 

Source
pub fn sub_datetime<D>(
    a: &Array<DateTime64, D>,
    b: &Array<DateTime64, D>,
) -> Result<Array<Timedelta64, D>, FerrayError>
where D: Dimension,
Expand description

Element-wise datetime - datetime → timedelta (same unit assumed).

NaT propagates: if either side is NaT at position i, the output is NaT at that position. Mirrors NumPy’s datetime64 - datetime64 semantics.

§Errors

Returns FerrayError::ShapeMismatch if the shapes differ.