pandas.to_timedelta(arg, unit='ns', box=True, coerce=False)

Convert argument to timedelta

Parameters :

arg : string, timedelta, array of strings (with possible NAs)

unit : unit of the arg (D,h,m,s,ms,us,ns) denote the unit, which is an integer/float number

box : boolean, default True

If True returns a Timedelta/TimedeltaIndex of the results if False returns a np.timedelta64 or ndarray of values of dtype timedelta64[ns]

coerce : force errors to NaT (False by default)

Returns :

ret : timedelta64/arrays of timedelta64 if parsing succeeded