I have a list of temperatur measurement:
temp = [ [39, 38.5, 38], [37,37.5, 36], [35,34.5, 34], [33,32.5, 32], [31,30.5, 30], [29,28.5, 28], [27,26.5,26] ]
every value is recorded every 5 hour over several days. First day is first list of temp:
[39, 38.5, 38], second day is second list of temp: [37, 37.5, 36] etc.
What I always do is, I loop over the 'temp' and calculate the time difference between the values and save this as list in time. (The time difference is always 5h)
time=[]
for t in temp:
for i,val in enumerate(t):
i=i*5
time.append(i)
print time
The output looks like this:
time: [0, 5, 10, 0, 5, 10, 0, 5, 10, 0, 5, 10, 0, 5, 10, 0, 5, 10, 0, 5, 10]
But I want to get sublists of every day, like:
time: [ [0, 5, 10] , [0, 5, 10], [0, 5, 10], [0, 5, 10], [0, 5, 10], [0, 5, 10], [0, 5, 10] ]
What`s wrong in my code?