to_timedelta64

function of dascore.proc.resample source

to_timedelta64(
    obj: float | | str ,
)

Convert an object to timedelta64.

This function accepts a wide range of inputs and returns something of the same shape, but converted to numpy’s timedelta64 representation.

Examples

# Convert a float to seconds
import dascore as dc
d_time_1 = dc.to_timedelta64(10.1232)
# also works on negative numbers
d_time_2 = dc.to_datetime64(-10.5)