Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

TakeSmallest

TakeSmallest[list,n]
gives the n numerically smallest elements in list, sorted in ascending order.

TakeSmallest[n]
represents an operator form of TakeSmallest that can be applied to an expression.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (5)Basic Examples  (5)

Take the two smallest numbers in a list:

In[1]:=
Click for copyable input
Out[1]=

Do the same using the operator form of TakeSmallest:

In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Take the two smallest values in an association:

In[4]:=
Click for copyable input
Out[4]=

Get the two smallest quantities in a list of Quantity objects:

In[1]:=
Click for copyable input
Out[1]=

Quantities can be present in multiple units:

In[2]:=
Click for copyable input
Out[2]=

Get the two least recent dates in a list of DateObject constructs:

In[1]:=
Click for copyable input
Out[1]=

By default, Missing[] and several other symbolic expressions are excluded from the results:

In[1]:=
Click for copyable input
Out[1]=

Take the 4 four smallest numbers, or as many as are available if fewer:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2015
(10.1)
| Updated in 2015
(10.3)