Skip to content

arg_min

Syntax

arg_min(list-expression)

Parameters

list-expression
an expression that evaluates to a list

Returns

The the index of the minimum value of the list parameter.

Description

Searches a list for its minimum element, and returns the index of the element.

Note that the index of the first element of a list is 0, the second element is 1, and so on.

The time complexity of this action is linear in relation to the size of the list.

It is an error if the argument is not a list-expression.

Examples

Find and print the min index of a list my_list and its value.

# Assuming my_list is defined earlier...
print("The min index of my_list is: ", arg_min(my_list))
print("Which contains the value: ", select(my_list, arg_min(my_list)))

See Also