Private
Public Access
1
0

removing obsolete .ix calls to pandas

This commit is contained in:
Sander Roosendaal
2019-02-09 08:52:52 +01:00
parent a5d8dbdf07
commit b88c6e902a
13 changed files with 93 additions and 85 deletions

View File

@@ -518,42 +518,42 @@ def add_workout_from_data(user,importid,data,strokedata,
lapidx = res[1]
unixtime = cum_time+starttimeunix
seconds = 0.1*strokedata.ix[:,'t']
seconds = 0.1*strokedata.loc[:,'t']
nr_rows = len(unixtime)
try:
latcoord = strokedata.ix[:,'lat']
loncoord = strokedata.ix[:,'lon']
latcoord = strokedata.loc[:,'lat']
loncoord = strokedata.loc[:,'lon']
except:
latcoord = np.zeros(nr_rows)
loncoord = np.zeros(nr_rows)
try:
strokelength = strokedata.ix[:,'strokelength']
strokelength = strokedata.loc[:,'strokelength']
except:
strokelength = np.zeros(nr_rows)
dist2 = 0.1*strokedata.ix[:,'d']
dist2 = 0.1*strokedata.loc[:,'d']
try:
spm = strokedata.ix[:,'spm']
spm = strokedata.loc[:,'spm']
except KeyError:
spm = 0*dist2
try:
hr = strokedata.ix[:,'hr']
hr = strokedata.loc[:,'hr']
except KeyError:
hr = 0*spm
pace = strokedata.ix[:,'p']/10.
pace = strokedata.loc[:,'p']/10.
pace = np.clip(pace,0,1e4)
pace = pace.replace(0,300)
velo = 500./pace
try:
power = strokedata.ix[:,'power']
power = strokedata.loc[:,'power']
except KeyError:
power = 2.8*velo**3