This is a little confusing so I will try my best to explain my goal. In a nutshell i'm trying to look at a sublist within a list. In those sublists, some have the same starting element (sublist[0]) and i want to record the differences between that sublist with other sublists starting with the same element
data = [['o1415', '1', '0', '1'], ['o1415', '0', '0', '0'], ['o1414', '0', '0', '0'], ['o1414', '1', '0', '0'], ['o1414', '0', '0', '0'], ['o1408', '0', '0', '1'], ['o1406', '0', '0', '0']]
D_changes = {}
here is a list with 4 elements . . the first of which has a name, 2nd/3rd/4th elements have digits .
i'm trying to generate a dictionary that has the {name:[then,the,differences])}
for example data[0] and data[1] both have 'o1415' as their first element . since they have the same string for the first element i want to compare the rest of the lists with each other . so data[0] differs in data[0][1] and data[0][2] from data[1] . . . so i want to add 'o1415':['first','third'] to the empty dictionary D_changes.
another example would be 'o1414' which is in data[2],data[3],data[4] and for these lists, one element is different in the [1] position so i'd like to add 'o1414' : ['first'] to the empty dictionary above
in the end i want to obtain a dictionary with this type of content
desired_changes = {'o1415':['first','third'],'o1414':['first'],'o1408':[],'o1406':[]}