Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Asked
Modified yesterday
Viewed 231 times
3
$\begingroup$

I can get the minimum and maximum of a list by using

#[list] &/@ {Min, Max}

I now want to use RankedMin and RankedMax, but I can't figure out how to get the parameter in there. I want RankedMin[list, 10] and RankedMax[list, 10]

This was answered for me in the Stack Overflow area, but I don't remember by whom. I'm putting this here in case it would be helpful for anyone else.

$\endgroup$
1
  • 4
    $\begingroup$ From the documentation (Applications) for Map: Map[f[#, 3] &, {a, b, c}] $\endgroup$
    Bob Hanlon
    –  Bob Hanlon
    2025-10-15 22:10:11 +00:00
    Commented 2 days ago

3 Answers 3

5
$\begingroup$
Through[{RankedMin, RankedMax}[list, 10]]
$\endgroup$
4
$\begingroup$

I would consider the following to be slightly cleaner:

ComapApply[{RankedMin, RankedMax}, {list, 10}]
$\endgroup$
3
$\begingroup$

I don't remember who gave me this answer.

{#[list, 10] & /@ {RankedMin, RankedMax}}
$\endgroup$

Your Answer

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.