I’m not sure if this is even possible but I want to merge a sublist if there is a partial and then remove the sublists from the main list.
s = [['X1: Cheese' ,' 99','98','97'], ['77','78','76'],['X1: Cheese','99','98','97','10','11'], ['X1: Cheese ','99','98','97','22','21'],['X1: NoCheese', '99','98','97']]
Output…
[['X1: Cheese' ,' 99','98','97','10','11','22','21'], ['77','78','76'], ,['X1: NoCheese', '99','98','97']]
So I’d be matching the ‘X1: Cheese’ and merging the values that don’t exist in the first sublist found.
The values here are all variables so can’t be searched simply by the word ‘Cheese’, they would have to be matched dynamically.
Not even sure how to approach this