max
is by default over the keys. This also avoids a type error because dict.get
actually returns an Optional
type.
#610
Labels
Type: Bug
Something isn't working
max
is by default over the keys. This also avoids a type error becausedict.get
actually returns anOptional
type.Originally posted by @jklaise in #541 (comment)
This change is causing me issues in newer versions. This change does not result in the same output. I think the goal is to find the key which is paired with the highest value. The new method just returns the key which is the highest value.
cat_vars
{0: 2, 2: 3, 5: 8, 13: 2, 15: 2, 17: 2, 19: 3}
max(cat_vars)
19
max(cat_vars,key=cat_vars.get)
5
Versions after this commit do not work with categorical features for me.
The text was updated successfully, but these errors were encountered: