distance, time sort of working
This commit is contained in:
@@ -371,10 +371,10 @@ def getfastest(df,thevalue,mode='distance'):
|
||||
|
||||
tmax = tt.max()
|
||||
if mode == 'distance':
|
||||
if dd.max() > thevalue:
|
||||
if dd.max() < thevalue:
|
||||
return 0
|
||||
else:
|
||||
if tt.max() > thevalue:
|
||||
if tt.max() < thevalue:
|
||||
return 0
|
||||
|
||||
if tmax > 500000:
|
||||
@@ -418,10 +418,16 @@ def getfastest(df,thevalue,mode='distance'):
|
||||
restime = np.array(restime)
|
||||
distance = np.array(distance)
|
||||
|
||||
#for i in range(len(restime)):
|
||||
# if restime[i]<thevalue*60*1000:
|
||||
# print(i,restime[i],distance[i],60*1000*thevalue)
|
||||
|
||||
d2 = 0
|
||||
if mode == 'distance':
|
||||
d2 = griddata(distance,restime,[thevalue],method='linear',rescale=True)
|
||||
return d2[0]/1000.
|
||||
else:
|
||||
d2 = griddata(restime,distance,[thevalue],method='linear',rescale=True)
|
||||
d2 = griddata(restime,distance,[thevalue*60*1000],method='linear',rescale=True)
|
||||
return d2[0]
|
||||
|
||||
return d2[0]/1000.
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user