Consider two different datasets.
The first looks like this:
0.033333284161002015 51.0
0.06666656832200403 0.0
0.09999985248300605 0.0
0.13333313664400806 0.0
0.16666642080501007 0.0
0.1999997049660121 0.0
0.2333329891270141 0.0
0.2666662732880161 0.0
0.29999955744901813 0.0
0.33333284161002014 0.0
0.36666612577102214 0.0
0.3999994099320242 0.0
and the second like this:
The first column gives a timestamp. In the first dataset time is measured in seconds, in the second dataset time is measured in milli seconds. Now, what I want to do is the following: Whenever time is more or less equal for both datasets, safe the values in the right column.
For example: 0.33333
seconds from the first dataset is more or less equal to 336
milliseconds from the second dataset.
Why do I want to do this? When I plot both datasets in just one figure, the result is this:
But I am only interested in the difference between these two stem plots at times where both plots are drawn.
I was hoping to be able to achieve this goal with the following python code:
CmpTimestamp = []
for index,element in enumerate(1stColumn1stDataset):
for idx,el in enumerate(1stColumn2ndDataset):
if truncate(element*100)/100 == truncate(el/10)/100:
CmpTimestamp.append(truncate(element*100)/100)
But for some reason my CmpTimestamp
list is empty.