Hi!
I want to plot movements over a year but dont get it to work. Do anyone have any suggestions that could help?
I want to plot movements over a year but dont get it to work. Do anyone have any suggestions that could help?
class Corrections: def __init__(self, data): self.data=data def DataError (self): movements=[] date=[] time=[] for n in enumerate(self.data): c=n[1].split() date.append(c[0]) time.append(c[1]) movements.append(int(c[2])) LN=[] for n in range(len(time)-1): LN.append(int(time[n][0:2])*24*60+int(time[n][3:5])*60+int(time[n][6:8])) for k in range(len(LN)-1): if LN[k+1]-LN[k] > 160: LN.insert(k+1,LN[k]+120) date.insert(k+1,date[k]) movements.insert(k+1,movements[k]) for n in range(0, len(movements)-1): if movements[n+1]-movements[n]>4: movements[n+1]=movements[n]+4 if movements[n+1]<movements[n]: movements[n+1]=movements[n] movement=np.diff(movements) self.date=date self.LN=LN self.movement=movement Corrections(test).DataError() class Registeredmovements(Corrections: def __init__(self,givendate): self.givendate=givendate def plotting(self): Y=[] D=[] for i in [i for i,x in enumerate(self.date) if x==givendate]: return i Y.append(self.date=date[i:i+281050]) D.append(self.LN=LN[i:i+281050]) M.append(self.movements=movements[i:i+281050]) plot(Y,M) plt.show() print(Registeredmovements('2015-01-25').plotting())