1

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:

enter image description here

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.33333seconds 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: enter image description here

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.

Luk
  • 1,009
  • 2
  • 15
  • 33
  • This sounds more like a data preparation question than a plotting question. Is that correct? I recommend you read this: https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples – Paul H May 25 '19 at 13:39

0 Answers0