exports better csv (NKLinkLogbook)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user