WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

MissingFallback [arg1,arg2,]

gives the first argument argi that is not MissingQ .

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Applications  
Properties & Relations  
See Also
Related Guides
History
Cite this Page

MissingFallback [arg1,arg2,]

gives the first argument argi that is not MissingQ .

Details

Examples

open all close all

Basic Examples  (2)

MissingFallback gives the first of its arguments that is not of the form Missing []:

Wolfram Language code: MissingFallback[1, 2]
Wolfram Language code: MissingFallback[Missing[], 2]
Wolfram Language code: MissingFallback[Missing["reason"], Missing[], 2]

If only missing elements are present, the last of them will be returned:

Wolfram Language code: MissingFallback[Missing["Unknown"], Missing["NotAvailable"]]

Use MissingFallback to replace missing values in a Tabular object with values of another column:

Wolfram Language code: tab = Tabular[{{1, 3, 5}, {2, Missing[], 6}}, {"a", "b", "c"}]
Wolfram Language code: TransformColumns[tab, "b" -> Function[MissingFallback[#b, #a]]]

Use a fixed value instead:

Wolfram Language code: TransformColumns[tab, "b" -> Function[MissingFallback[#b, -99]]]

Scope  (1)

Use functions of columns in MissingFallback to fill in missing values in a Tabular object:

Wolfram Language code: tab = ToTabular[{"a" -> {1, 2, 3}, "b" -> {4, Missing[], 6}, "c" -> {7, 8, 9}}, "Columns"]

Use the sum of row values from other columns:

Wolfram Language code: TransformColumns[tab, "b" -> Function[MissingFallback[#b, #a + #c]]]

Use the mean of row values from neighboring columns:

Wolfram Language code: TransformColumns[tab, "b" -> Function[MissingFallback[#b, Mean[{#a, #c}]]]]

Applications  (2)

Construct a Tabular object with a column containing the moons of Pluto:

Wolfram Language code: plutoMoons = ToTabular[{"moon" -> EntityList[EntityClass["PlanetaryMoon", "PlutoMoon"]]}, "Columns"]

Some of those moons have a Missing ["NotAvailable"] value for the "PolarRadius" property:

Wolfram Language code: TransformColumns[plutoMoons, "size" -> Function[#moon["PolarRadius"]]]

Use the "Radius" property as fallback:

Wolfram Language code: TransformColumns[plutoMoons, "size" -> Function[MissingFallback[#moon["PolarRadius"], #moon["Radius"]]]]

Take a Tabular object of Palmer penguin data:

Wolfram Language code: penguins = ResourceData["Sample Tabular Data: Palmer Penguins"]

Create a pivot table of penguin species and sex distribution over the islands:

Wolfram Language code: pt = PivotTable[penguins, Length[#species]&, {"island"}, {"species", "sex"}]

The resulting table has missing values:

Wolfram Language code: TabularStructure[pt, {ExtendedKey["Gentoo", "female"], ExtendedKey["Gentoo", "male"], ExtendedKey["Chinstrap", "female"], ExtendedKey["Chinstrap", "male"]}, "MissingCount"]

Use MissingFallback to fill in Missing values to compute total of all female penguins for each island:

Wolfram Language code: mf[key_] := MissingFallback[key, 0]
Wolfram Language code: females = ColumnKeys[pt, MatchQ[#ColumnKey, ExtendedKey[_, "female"]]&]
Wolfram Language code: ConstructColumns[pt, {"island", "females" -> Function[Total[mf /@ (# /@ females)]]}]

Properties & Relations  (2)

If all arguments of MissingFallback are Missing [] objects, the last one is returned:

Wolfram Language code: MissingFallback[Missing["reason1"], Missing[], Missing["reason2"]]

The symbol Missing is not treated as a missing object:

Wolfram Language code: MissingFallback[Missing, x]
Wolfram Language code: MissingQ[Missing]

Missing [] with no arguments is treated as a missing object:

Wolfram Language code: MissingFallback[Missing[], x]
Wolfram Language code: MissingQ[Missing[]]
Wolfram Research (2025), MissingFallback, Wolfram Language function, https://reference.wolfram.com/language/ref/MissingFallback.html.

Text

Wolfram Research (2025), MissingFallback, Wolfram Language function, https://reference.wolfram.com/language/ref/MissingFallback.html.

CMS

Wolfram Language. 2025. "MissingFallback." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MissingFallback.html.

APA

Wolfram Language. (2025). MissingFallback. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MissingFallback.html

BibTeX

@misc{reference.wolfram_2026_missingfallback, author="Wolfram Research", title="{MissingFallback}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/MissingFallback.html}", note=[Accessed: 20-August-2026]}

BibLaTeX

@online{reference.wolfram_2026_missingfallback, organization={Wolfram Research}, title={MissingFallback}, year={2025}, url={https://reference.wolfram.com/language/ref/MissingFallback.html}, note=[Accessed: 20-August-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /