Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Minimum by key function

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images