Why will python function max() return different outputs if float('NaN') value is permuted in a dictionary but key-max_value remains the same?
Why will python function max() return different outputs if float('NaN') value is permuted in a dictionary but key-max_value remains the same? Question: Let’s pretend I have the following simple dictionary: dictionary = {‘a’:3, ‘b’:4, ‘c’:float(‘NaN’)} If I use function max() to return the key with maximum value… key_maxvalue = max(dictionary, key=dictionary.get) print(key_maxvalue) …python outputs this: …