I have following dict and would like to get a key from it based upon list of values:
d = {
'Mot': [5250, 1085, 1085, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
'Dek': [0, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0],
'Nas': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
'Ost': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
'Suk': [0, 0, 0, 0, 0, 0, 0, 3156, 1320, 450, 0, 0, 0],
'Tas': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0, 0],
'Sat': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6551, 5000]
}
dz = [[5250, 1085, 1085, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
I tried to adopt get() method without any success (returning this error: unhashable type: 'list'; the same happened when I tried to have numpy's array instead returning: unhashable type: 'numpy.ndarray'):
tN= []
for index, element in enumerate(dz):
tN.append(dict((v,k) for k,v in dict_res.items()).get(element))
Is there any way how to retrieve the values from dictionary like that?