Skip to content

TakeSmallestBy

TakeSmallestBy({e_1, e_2, ..., e_i}, function, n)

returns the n values from the list {e_1, e_2, ..., e_i}, where function(e_i) is smallest.

Examples

>> TakeSmallestBy(Prime(Range(10)),Mod(#,7)&, 3)
{7,29,2}

Implementation status

  • ✅ - full supported

Github