You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--
The original poster of #14672 asked for a function that would find the key of the minimum (or maximum) of the values in a dictionary.
In the last post before the issue was closed
JeffBezanson commented on Sep 14, 2017 commented:
findmax and indmax now do what the OP requests. If you want the maximum value, maximum(values(d))works. From there, I think it's simplest for maximum just to operate on iterators like it does now, so the behavior with pairs is strange but it's what falls out. I think the only possible further change from there is to change how Dicts iterate.
However while true for v0.7, this is not the case for v0.6
d =Dict('a'=>4, 'b'=>3, 'c'=>2, 'd'=>1)
findmin(d) # gives (1,'d') in v0.7, but ('a'=>4, 2) in v0.6
The text was updated successfully, but these errors were encountered:
--
The original poster of #14672 asked for a function that would find the key of the minimum (or maximum) of the values in a dictionary.
In the last post before the issue was closed
JeffBezanson commented on Sep 14, 2017 commented:
findmax and indmax now do what the OP requests. If you want the maximum value, maximum(values(d))works. From there, I think it's simplest for maximum just to operate on iterators like it does now, so the behavior with pairs is strange but it's what falls out. I think the only possible further change from there is to change how Dicts iterate.
However while true for v0.7, this is not the case for v0.6
The text was updated successfully, but these errors were encountered: