Private
Public Access
1
0

division by zero fix in dataprep

This commit is contained in:
Sander Roosendaal
2018-04-30 12:53:38 +02:00
parent 30dac76396
commit 772bb41ecf

View File

@@ -759,9 +759,11 @@ def create_row_df(r,distance,duration,startdatetime,
totalseconds += duration.second
totalseconds += duration.microsecond/1.e6
spm = 60.*nr_strokes/totalseconds
try:
spm = 60.*nr_strokes/totalseconds
except ZeroDivisionError:
spm = 20.
step = totalseconds/float(nr_strokes)
elapsed = np.arange(nr_strokes)*totalseconds/(float(nr_strokes-1))
@@ -775,7 +777,10 @@ def create_row_df(r,distance,duration,startdatetime,
pace = 500.*totalseconds/distance
if workouttype in ['rower','slides','dynamic']:
velo = distance/totalseconds
try:
velo = distance/totalseconds
except ZeroDivisionError:
velo = 2.4
power = 2.8*velo**3
else:
power = 0