DeleteMissing

DeleteMissing[list]
drops elements with head Missing from a list.

DeleteMissing[assoc]
drops elements whose values have head Missing from the association assoc.

DeleteMissing[expr,n]
applies DeleteMissing to any lists or associations that occur within the first n levels of expr.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Delete Missing elements in a list:

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

Delete Missing values from an association:

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

Delete Missing elements up to level 2:

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

Without an explicit level, only the top level is processed:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2014
(10.0)