Reputation: 2910
The following expression
(reduce (fn [[c x y] [s k d]] (if (< c s) [s k d] [c x y])) [0 0 0] colls)
Is for the element [e, x, y]
in colls such that e
is the maximum among all in the tuples in colls.
Is there already an idiomatic expression in Clojure for that? I guess that with macro, it should be possible to express it with brevity.
I feel that Python/numpy/panda has some good example.
Upvotes: 1
Views: 57