Private
Public Access
1
0

Reduced data stream to cum_flex

This commit is contained in:
Sander Roosendaal
2016-11-22 10:49:55 +01:00
parent dad87fe7f5
commit b16c6c7fbd
7 changed files with 4656 additions and 37 deletions

View File

@@ -79,6 +79,38 @@ def getrowdata(id=0):
return rowdata,row
def smalldataprep(therows,xparam,yparam1,yparam2):
df = pd.DataFrame()
if yparam2 == 'None':
yparam2 = 'power'
df[xparam] = []
df[yparam1] = []
df[yparam2] = []
df['distance'] = []
df['spm'] = []
for workout in therows:
f1 = workout.csvfilename
try:
rowdata = dataprep(rrdata(f1).df)
rowdata = pd.DataFrame({xparam: rowdata[xparam],
yparam1: rowdata[yparam1],
yparam2: rowdata[yparam2],
'distance': rowdata['distance'],
'spm': rowdata['spm'],
}
)
df = pd.concat([df,rowdata],ignore_index=True)
except IOError:
pass
return df
def dataprep(rowdatadf,bands=False,barchart=False,otwpower=False):
rowdatadf.set_index([range(len(rowdatadf))],inplace=True)
t = rowdatadf.ix[:,'TimeStamp (sec)']
@@ -113,7 +145,10 @@ def dataprep(rowdatadf,bands=False,barchart=False,otwpower=False):
drivelength = savgol_filter(drivelength,windowsize,3)
forceratio = savgol_filter(forceratio,windowsize,3)
t2 = t.fillna(method='ffill').apply(lambda x: timedeltaconv(x))
try:
t2 = t.fillna(method='ffill').apply(lambda x: timedeltaconv(x))
except TypeError:
t2 = 0*t
p2 = p.fillna(method='ffill').apply(lambda x: timedeltaconv(x))