I have a two Lists one with truth values and other containing experimental results and their associated scores.
truth = [6, 8, 7, 10]
experiment = [(6, 5), (4, 3), (2, 4), (11, 6), (7, 4)]
I want to align my experiment and truth values such that maximum truth value align
[6, 8, 7, 10]
[6, missing, 7, missing]
Now I'd like to assign value to missing from the from among subsequences which are not aligned.
Here we chose 11 from among (4, 3), (2, 4), (11, 6)
since it has the highest score.
The last missing value is assigned 0
because no element lies beyond (7, 4)
truth = [6, 8, 7, 10]
exp = [6, 11, 7, 0] # Zero because 7 is the last element of experiment subsequence.
I was looking in difflib
library but didn't understand much.
How should I go about this?