29 Aug
2020
29 Aug
'20
12:42 p.m.
I'd like to propose adding argmax and argmin functions to the python list. These functions return the index of a maximum / minimum element of the list. Eg: a = [1, 4, 2, 3] print(a.argmax()) # 1 print(a.argmin()) # 0 It's a very popular request (based on stackoverflow https://stackoverflow.com/questions/16945518/finding-the-index-of-the-value-... ), and currently there is no elegant way to find it. What do you think?