Basic Examples
Basic Examples
Take two numbers larger than the specified value in a list:
In[]:=
list={1,3,5,4}
Out[]=
{1,3,5,4}
In[]:=
Out[]=
{4,5}
Do the same using the operator form of :
TakeLarger
In[]:=
list//[3,2]
Out[]=
{4,5}
In[]:=
Out[]=
{4,5}
Take the two values larger than the specified threshold in an association:
In[]:=
Out[]=
e4,d5
Take 4 numbers larger than the specified value, or as many as are available:
In[]:=
Out[]=
{4,7}
All numbers larger than a threshold:
In[]:=
Out[]=
{4,5,7}
Take two values in a list of objects:
In[]:=
Out[]=
,
Scope
Scope
Get the two smallest elements that are larger than 3 in a list:
In[]:=
π
π
Out[]=
{7π,}
π
Get the positions of the two smallest elements larger than 3:
In[]:=
list={,7π,,23};
π
π
In[]:=
Out[]=
{2,3}
Get the elements along with their positions:
In[]:=
Out[]=
{{7π,2},{,3}}
π
Let positions come first in the result:
In[]:=
Out[]=
{{2,7π},{3,}}
π
Get associations containing the element and the position:
In[]:=
Out[]=
{Element7π,Index2,Element,Index3}
π
Get the two smallest planets with radii larger than the Earth’s:
In[]:=
Out[]=
,