I have a dictionary having following structure
{key1: [1,2,3,4,5], key2: [2,0,4,5,6]}
I need to find maximum and minimum value of each index of the value list, so at index 0, we compare 1 and 2
and choose 2
as the maximum, and 1
as the minimum, etc.
Expected output for my example:
min = [1,0,3,4,5]
max = [2,2,4,5,6]
I cannot use operator as I am not allowed to import it. I tried to used following approach but failed (syntax error). Also I won't iterate through the value set as is not the elegant way (IMO).
maxVal = max(myDictionary.items(), key=(lambda k: myDictionary[k]))
gives me
TypeError: unhashable type: 'list'
Can you correct it or suggest any alternative approach.