Private
Public Access
1
0

bug fixes

This commit is contained in:
Sander Roosendaal
2021-07-12 08:05:11 +02:00
parent dc55982128
commit b5537af783
2 changed files with 8 additions and 2 deletions

View File

@@ -157,7 +157,10 @@ def createsporttracksworkoutdata(w):
# adding diff, trying to see if this is valid # adding diff, trying to see if this is valid
#t = row.df.loc[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)'] #t = row.df.loc[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']
t = row.df.loc[:,'TimeStamp (sec)'].values-row.df.loc[:,'TimeStamp (sec)'].iloc[0] t = row.df.loc[:,'TimeStamp (sec)'].values-row.df.loc[:,'TimeStamp (sec)'].iloc[0]
t[0] = t[1] try:
t[0] = t[1]
except IndexError:
return 0
d = row.df.loc[:,'cum_dist'].values d = row.df.loc[:,'cum_dist'].values
d[0] = d[1] d[0] = d[1]

View File

@@ -388,7 +388,10 @@ def wavg(group, avg_name, weight_name):
In rare instance, we may not have weights, so just return the mean. Customize this if your business case In rare instance, we may not have weights, so just return the mean. Customize this if your business case
should return otherwise. should return otherwise.
""" """
d = group[avg_name] try:
d = group[avg_name]
except KeyError:
return 0
try: try:
w = group[weight_name] w = group[weight_name]
except KeyError: except KeyError: