Private
Public Access
1
0

exports better csv (NKLinkLogbook)

This commit is contained in:
Sander Roosendaal
2021-04-04 13:34:56 +02:00
parent ec6de05630
commit f82c451e58
2 changed files with 10 additions and 3 deletions

View File

@@ -2874,7 +2874,6 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
rowdatadf[' ElapsedTime (sec)'] = rowdatadf['TimeStamp (sec)']
if empower:
print('aap')
try:
wash = rowdatadf.loc[:, 'wash']
except KeyError:

View File

@@ -228,11 +228,19 @@ def get_workout(user,nkid):
oarlockData = df['oarlockStrokes']
oarlockData = oarlockData.apply(lambda x:getdict(x, seatIndex=1))
df2 = pd.DataFrame.from_records(oarlockData.values)
df2 = df2.rename(columns={"timestamp":"ts"})
df = pd.concat([df,df2],axis=1)
df.set_index('timestamp')
df2.set_index('timestamp')
df = df.merge(df2,left_index=True,right_index=True)
df = df.rename(columns={"timestamp_x":"timestamp"})
df = df.drop('oarlockStrokes',axis=1)
df.sort_values(by='timestamp',ascending=True,inplace=True)
df.fillna(inplace=True,method='ffill')
#df = pd.concat([df,df2],axis=1)
# not to_csv and run upload API!
df.to_csv('~/Downloads/nk_logbook.csv')
# get workout data