[python] index of absolute maximum value in a list

Yes I am getting the max of an enumerated list : a list of tuples of (index, value)
The key is a lambda function which returns abs(item [1]) from the tuple. The max function therefore returns the tuple with the highest absolute value inside. I then stick a [0] at the very end of the line to get just the index from the returned tuple
Does that make sense? You may need to test these steps one by one to follow…

1 Like