same basis of logarithmic delta axis
This commit is contained in:
@@ -1034,10 +1034,10 @@ def fetchcp_new(rower,workouts):
|
||||
except KeyError:
|
||||
powermean = 0
|
||||
|
||||
|
||||
if powermean != 0:
|
||||
thesecs = totaltime
|
||||
maxt = 1.05 * thesecs
|
||||
|
||||
if maxt > 0:
|
||||
logarr = datautils.getlogarr(maxt)
|
||||
dfgrouped = strokesdf.groupby(['workoutid'])
|
||||
@@ -1052,6 +1052,8 @@ def fetchcp_new(rower,workouts):
|
||||
data.append(df)
|
||||
|
||||
|
||||
if len(data) == 0:
|
||||
return pd.Series(),pd.Series(),0
|
||||
if len(data)>1:
|
||||
df = pd.concat(data,axis=0)
|
||||
|
||||
@@ -1059,22 +1061,22 @@ def fetchcp_new(rower,workouts):
|
||||
|
||||
|
||||
df = df.sort_values(['delta']).reset_index()
|
||||
dindex = df['id'].shift(1)-df['id']
|
||||
dpowerplus = df['cp'].shift(1)-df['cp']
|
||||
dpowermin = df['cp'].shift(-1)-df['cp']
|
||||
badrows = []
|
||||
badid = 0
|
||||
for index,row in df.iterrows():
|
||||
if dindex[index] != 0 and dpowermin[index] > 0:
|
||||
badrows.append(index)
|
||||
badid = row['id']
|
||||
elif row['id'] == badid:
|
||||
badrows.append(index)
|
||||
else:
|
||||
badid = 0
|
||||
#dindex = df['id'].shift(1)-df['id']
|
||||
#dpowerplus = df['cp'].shift(1)-df['cp']
|
||||
#dpowermin = df['cp'].shift(-1)-df['cp']
|
||||
#badrows = []
|
||||
#badid = 0
|
||||
#for index,row in df.iterrows():
|
||||
# if dindex[index] != 0 and dpowermin[index] > 0:
|
||||
# badrows.append(index)
|
||||
# badid = row['id']
|
||||
# elif row['id'] == badid:
|
||||
# badrows.append(index)
|
||||
# else:
|
||||
# badid = 0
|
||||
|
||||
|
||||
df = df.drop(index = badrows)
|
||||
#df = df.drop(index = badrows)
|
||||
|
||||
|
||||
return df['delta'],df['cp'],0
|
||||
|
||||
Reference in New Issue
Block a user