def __init__(self, x, y, t):
try:
if (len(x) != len(y) or len(y) != len(t)):
raise Exception('Os arrays x, y e t precisam ser do mesmo tamanho')
except:
raise Exception('Os atributos x, y e t precisam ser um arrays')
self.unit = 's'
self.x = np.array(x, dtype='f8')
self.y = np.array(y, dtype='f8')
self.t = np.array(t, dtype='datetime64[{}]'.format(self.unit))
self.seconds = (self.t - np.datetime64("1970-01-01T00:00:00")) / np.timedelta64(1, 's')
self._t = {str(v): i for i, v in enumerate(t)}
评论列表
文章目录