How to subtract two 2D lists in python?
Question: **I need to subract two 2D lists like this** :

    
    
    list1= [['some',2],['other',1],['thing',5]]
    
    list2= [['some',1],['thing',5]]
    

**result should be like this** :

    
    
    result= [['some',1],['other',1],['thing',0]]
    

**or**

    
    
    result= [['some',1],['other',1]]
    

It should be a list, not a dictionary; the order doesn't matter.


Answer: 
    from collections import Counter
    list1= [['some',2],['other',1],['thing',5]]
    
    list2= [['some',1],['thing',5]]
    c1 = Counter({item[0]: item[1] for item in list1})
    c2 = Counter({item[0]: item[1] for item in list2})
    result = [[key, value] for key, value in (c1-c2).items()]
    
    result
    [['other', 1], ['some', 1]]
    

