dict = {'ENSTRUT00000047813': '1680', 'ENSTRUT00000047812': '2067', 'ENSTRUT00000047811': '2067', 'ENSTRUT00000047810': '2088', 'ENSTRUT00000047814': '738', 'ENSTRUT00000047808': '2208', 'ENSTRUT00000047809': '2001'}
I want to find out the key with max value from the dict
I am using the
protein = max(dict.iteritems(),key=operator.itemgetter(1))[0]
but it will give me results as
'ENSTRUT00000047814'
though i know that it sort the values in the dict and then give the max, but eventually it report '738' bigger than any other values starting from either '1' or '2' like 1680 or 2067 respectively.