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.
DeleteMissing[expr,n,d]
considers an element at level n to be missing if Missing occurs within the first d levels of the element.
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.
DeleteMissing[expr,n,d]
considers an element at level n to be missing if Missing occurs within the first d levels of the element.
Details
- DeleteMissing[{lhs1->rhs1,…}] deletes any elements of the list when rhsi has head Missing.
- DeleteMissing[expr,Infinity] specifies that DeleteMissing should search to arbitrary depth for expressions with head Missing and delete them.
- DeleteMissing[expr,1,Infinity] indicates that elements at the first level should be removed if they contain Missing at any depth.
- When searching multiple levels, DeleteMissing will only search within lists and associations and ignores expressions with other heads.
- DeleteMissing[Missing[]] returns Sequence[].
Examples
open all close allBasic Examples (2)
Scope (3)
Delete elements with head Missing up to level 2:
data = {{a, b, c}, {d, Missing[], {e, Missing[]}}};
DeleteMissing[data, 2]Delete missing elements at all levels:
data = {{a, b, c}, {d, Missing[], {e, Missing[]}}};
DeleteMissing[data, Infinity]Delete elements at level 1 if they contain an element with head Missing:
data = {{a, 1}, {b, 2}, {c, Missing[]}, {d, {Missing[]}}};
DeleteMissing[data, 1, 1]Delete elements at level 1 if they contain a missing expression anywhere inside:
DeleteMissing[data, 1, Infinity]DeleteMissing deletes complete rules when the right-hand side is Missing:
DeleteMissing[{a -> 1, b -> Missing[], c -> 3, d -> Missing[]}]Properties & Relations (2)
DeleteMissing[expr] deletes missing elements at the top level only:
DeleteMissing[{a, Missing[], {d, Missing[], e}}]DeleteMissing[list] is effectively equivalent to DeleteCases[list,_Missing]:
data = {a, Missing[], b, {Missing[]}};DeleteMissing[data] == DeleteCases[data, _Missing]Possible Issues (1)
DeleteMissing does not enter heads other than List or Association:
DeleteMissing[{a -> {x, Missing[]}, y}, Infinity]DeleteMissing[{f[x, Missing[], y]}, Infinity]See Also
Related Guides
Text
Wolfram Research (2014), DeleteMissing, Wolfram Language function, https://reference.wolfram.com/language/ref/DeleteMissing.html (updated 2015).
CMS
Wolfram Language. 2014. "DeleteMissing." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/DeleteMissing.html.
APA
Wolfram Language. (2014). DeleteMissing. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DeleteMissing.html
BibTeX
@misc{reference.wolfram_2026_deletemissing, author="Wolfram Research", title="{DeleteMissing}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/DeleteMissing.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_deletemissing, organization={Wolfram Research}, title={DeleteMissing}, year={2015}, url={https://reference.wolfram.com/language/ref/DeleteMissing.html}, note=[Accessed: 12-June-2026]}