I need to get a timedelta as a full float of seconds and microseconds, for instance 2.786 seconds. Doing this with datetime64's specifying 'ms' as milliseconds
elapsed_time = np.datetime64(dial_1, 'ms') - np.datetime64(dial_2, 'ms')
Gives me numpy.timedelta64(-2786,'ms')
Great, but I need that in seconds. Doing that now by specifying seconds
elapsed_time = np.datetime64(dial_1, 's') - np.datetime64(dial_2, 's')
Now gives numpy.timedelta64(-3,'s')
and has rounded it upto a whole 3 seconds. I just want to know how to get the decimal 2.786 seconds
Any help much appreciated
Relation in
second
&milisecond
If we take 2 dials i.e
dial_1=0 milisecond
anddial_2=2786 milisecond
, thenoutput in milisecond-->
if we need output in
float
then usetimedelta64
output in second-->