How can I find the minimum value of an array, but evaluating the minimum through a key function?
In Python,
In [6]: min([-3, -1, 2], key=abs)
Out[6]: -1
3 posts - 3 participants
How can I find the minimum value of an array, but evaluating the minimum through a key function?
In Python,
In [6]: min([-3, -1, 2], key=abs)
Out[6]: -1
3 posts - 3 participants