MissingBehavior
Details
- The following settings can be given:
-
None use ordinary behavior of Missing Automatic invoke special rules for Mean, Total, etc. - Special behavior invoked by the setting MissingBehavior->Automatic includes:
-
Mean,Median,StandardDeviation,… empty lists yield Missing["Indeterminate"] Total,Mean,Median,Min,Max,… Missing elements are dropped or ignored Times,Minus,Power,… Missing elements yield Missing["Indeterminate"] Counts,GroupBy,Map,… application to a single Missing yields another Missing
Examples
open all close allBasic Examples (1)
Scope (4)
Statistics functions on list of objects ignore Missing objects by default in Query operations:
Query[Mean][{2, 4, Missing["reason"]}]They act in the same way on Dataset operations:
Dataset[{2, 4, Missing["reason"]}][Mean]Using MissingBehaviorNone makes Missing objects be preserved:
Query[Mean, MissingBehavior -> None][{2, 4, Missing["reason"]}]This would be equivalent to direct action of Mean on the list or Dataset object:
Mean[{2, 4, Missing["reason"]}]Mean[Dataset[{2, 4, Missing["reason"]}]]Statistics functions on lists of insufficient length return Missing["Indeterminate"]:
Query[Mean][{}]Query[StandardDeviation][{3}]Some operations with variable number of arguments ignore Missing objects by default in Query:
Query[Apply[Plus]][{2, 4, Missing["reason"]}]They act in the same way on Dataset operations:
Dataset[{2, 4, Missing["reason"]}][Apply[Plus]]Using MissingBehaviorNone makes Missing objects be preserved:
Query[Apply[Plus], MissingBehavior -> None][{2, 4, Missing["reason"]}]Other operations return Missing["Indeterminate"] by default:
Query[Apply[Times]][{2, 4, Missing["reason"]}]Dataset[{2, 4, Missing["reason"]}][Apply[Times]]Using MissingBehaviorNone makes Missing objects be preserved:
Query[Apply[Times], MissingBehavior -> None][{2, 4, Missing["reason"]}]Structural and extraction operations in Query always preserve Missing objects:
Query[GroupBy[Head]][{2, Missing[], 4, Missing["reason"]}]The value of the MissingBehavior option does not affect the result:
Query[GroupBy[Head], MissingBehavior -> Automatic][{2, Missing[], 4, Missing["reason"]}]Query[GroupBy[Head], MissingBehavior -> None][{2, Missing[], 4, Missing["reason"]}]Properties & Relations (2)
Dataset[…][f] is equivalent to Query[f][Dataset[…]] and uses default settings for MissingBehavior:
ds = Dataset[{3, Missing[], 7}]ds[Mean]Query[Mean][ds]Use Query[f,options][Dataset[…]] to pass options to the Query operation:
Query[Mean, MissingBehavior -> None][ds]Mathematical Query operations can return Missing["Indeterminate"] by default in invalid cases:
Query[Variance][{2}]Specify MissingBehaviorNone to change to Failure results:
Query[Variance, MissingBehavior -> None][{2}]See Also
Related Guides
History
Text
Wolfram Research (2014), MissingBehavior, Wolfram Language function, https://reference.wolfram.com/language/ref/MissingBehavior.html.
CMS
Wolfram Language. 2014. "MissingBehavior." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MissingBehavior.html.
APA
Wolfram Language. (2014). MissingBehavior. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MissingBehavior.html
BibTeX
@misc{reference.wolfram_2026_missingbehavior, author="Wolfram Research", title="{MissingBehavior}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MissingBehavior.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_missingbehavior, organization={Wolfram Research}, title={MissingBehavior}, year={2014}, url={https://reference.wolfram.com/language/ref/MissingBehavior.html}, note=[Accessed: 13-June-2026]}