# Import import sys sys.path.append('../') import loadData import datetime # Data data = loadData.getID1Data() #data = data[0:50] groups = [] # Generate diff m = 60 h = 60 * 60 d = 24 * 60 * 60 T = 5 * m # en secondes (s) i = 1 a = 0 while i < len(data): b = i - 1 previous = data[i-1] current = data[i] diff_t = current[2] - previous[2] if diff_t > T: groups.append([a, b]) a = i i += 1
__author__ = 'Gabriel' ''' Goals : show speed show dayweek day hours:minutes ''' import loadData as ld import numpy as np import datetime import math #Get the data data = ld.getID1Data() def addSpeed(data): height,length = data.shape speedArray = np.zeros((height,1)) def speed(lat1,long1,t1,lat2,long2,t2): if t1 != t2: return math.sqrt((lat1-lat2)**2 + (long1-long2)**2)/(t2-t1) else: return 0.0 lat1,long1,t1 = tuple(data[0])