Fixed dataprep
This commit is contained in:
@@ -85,7 +85,7 @@ def rdata(file,rower=rrower()):
|
||||
return res
|
||||
|
||||
def delete_strokedata(id):
|
||||
query = sa.text('DELETE FROM strokedata WHERE workoutid={id};'.format(
|
||||
query = sa.text('DELETE FROM strokedata * WHERE workoutid={id};'.format(
|
||||
id=id,
|
||||
))
|
||||
with engine.connect() as conn, conn.begin():
|
||||
@@ -108,8 +108,6 @@ def getrowdata_db(id=0):
|
||||
# data['ergpace'] = data['ergpace']/1.0e6
|
||||
# data['nowindpace'] = data['nowindpace']/1.0e6
|
||||
# data['time'] = data['time']/1.0e6
|
||||
data['pace'] = data['pseconds']*1.0e3
|
||||
data['time'] = data['timesecs']*1.0e3
|
||||
data['x_right'] = data['x_right']/1.0e6
|
||||
if data.empty:
|
||||
rowdata,row = getrowdata(id=id)
|
||||
@@ -126,13 +124,6 @@ def getsmallrowdata_db(columns,ids=[]):
|
||||
prepmultipledata(ids)
|
||||
data = read_cols_df_sql(ids,columns)
|
||||
print columns
|
||||
for column in columns:
|
||||
if column == 'time':
|
||||
data['time'] = data['timesecs']*1.0e3
|
||||
# data['time'] = data['time']/1.0e6
|
||||
if column == 'pace':
|
||||
# data['pace'] = data['pace']/1.0e6
|
||||
data['pace'] = data['pseconds']*1.0e3
|
||||
|
||||
return data
|
||||
|
||||
@@ -293,11 +284,9 @@ def dataprep(rowdatadf,id=0,bands=False,barchart=False,otwpower=False):
|
||||
|
||||
data = DataFrame(
|
||||
dict(
|
||||
time = t2,
|
||||
timesecs = t,
|
||||
time = t*1e3,
|
||||
hr = hr,
|
||||
pace = p2,
|
||||
pseconds=p,
|
||||
pace = p*1e3,
|
||||
spm = spm,
|
||||
cumdist = cumdist,
|
||||
ftime = niceformat(t2),
|
||||
|
||||
Reference in New Issue
Block a user