TransformMissing
✖
TransformMissing
replaces instances of Missing[…] in tabular data tab according to the specification spec.
uses the specification speci to replace missing elements in coli.
Details and Options



- TransformMissing is also known as missing handling and missing imputation.
- TransformMissing is used to replace missing elements in a dataset with values that can be specified or inferred from the known part of the data.
- Missing value handling is typically used to maintain dataset integrity (often required for further data processing) and to preserve the original dataset sample size.
- Possible forms of tab include:
-
{assoc1,…} a list of associations {x11,…} a matrix Dataset[…] a dataset object Tabular[…] a tabular object - Transformation specification spec based on the all the non-missing column values includes:
-
" Mean" the mean value "Median" the median value "Mode" the most frequent value - These methods assume missing data is random (MCAR) and the imputed value reflects a consistent, representative dataset, working best when data lacks skew or outliers.
- Transformation based on a constant value includes:
-
{"Constant", val} a constant value val - Transformation based on sampling includes:
-
"RandomElement" randomly selected value {"RandomVariate",dist} value sampled from dist - If the distribution dist has free parameters, these will be estimated from the non-missing data using EstimatedDistribution.
- Transformation based on the element position includes:
-
"NearestElement" use the closest non-missing element "NextElement" use the next non-missing element "PreviousElement" use the previous non-missing element - These methods assume that missing values are similar to nearby data points and are useful for filling small gaps in sequential or time-based data.
- Transformation based on interpolation includes:
-
"Interpolation" use interpolation {"Interpolation",InterpolationOrderdegree} specify the interpolation order degree - Interpolation assumes that missing data lies on a smooth, continuous path between known points, making it most effective for datasets with gradual changes and minimal sharp fluctuations.
- Additional methods can be implemented using TransformColumns and other transformation functions.
- When specifying the desired columns, coli can have the following formats:
-
n the nth column "name" the column "name" TypeSpecifier[…] columns matching the specified type All all the columns Automatic automatically find columns based on spec (default)
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Replace missing elements by using the mean value of the columns:

https://wolfram.com/xid/01yw72zq9wi-gm5klw

https://wolfram.com/xid/01yw72zq9wi-5jxcm2


https://wolfram.com/xid/01yw72zq9wi-wd8p0w

Fit a distribution on the column data and sample from it:

https://wolfram.com/xid/01yw72zq9wi-hn33dq

Scope (15)Survey of the scope of standard use cases
Column Specification (4)
Transform the specified column:

https://wolfram.com/xid/01yw72zq9wi-hjkmot


https://wolfram.com/xid/01yw72zq9wi-n09e82


https://wolfram.com/xid/01yw72zq9wi-5qzlrr

Transform the columns that are compatible with the "Mean" transformation:

https://wolfram.com/xid/01yw72zq9wi-twk56u


https://wolfram.com/xid/01yw72zq9wi-y6swde

Transformations (11)
Constant (4)
Impute missing values with the mean of a column:

https://wolfram.com/xid/01yw72zq9wi-dcrl4m

Impute missing values with the median of a column:

https://wolfram.com/xid/01yw72zq9wi-oajp41

Impute missing values with the most common value of a column:

https://wolfram.com/xid/01yw72zq9wi-wm6ti3

Impute missing values with a constant value:

https://wolfram.com/xid/01yw72zq9wi-kw9t4f

Random (2)
Impute each missing value with a random choice from its column:

https://wolfram.com/xid/01yw72zq9wi-qpn60r

Sample from a given distribution:

https://wolfram.com/xid/01yw72zq9wi-h55k2g

Sample after estimating the distribution on the (non-missing) column values:

https://wolfram.com/xid/01yw72zq9wi-qv8jml

Position Based (3)
Replace missing values using the previous non-missing value:

https://wolfram.com/xid/01yw72zq9wi-7y59e

Replace missing values using the next non-missing value:

https://wolfram.com/xid/01yw72zq9wi-y8ugmx

Replace missing values using the closest non-missing value:

https://wolfram.com/xid/01yw72zq9wi-rt232y

Interpolation Based (2)
Impute missing values sampling from an InterpolatingFunction:

https://wolfram.com/xid/01yw72zq9wi-3qf7ne

Specify an interpolation order:

https://wolfram.com/xid/01yw72zq9wi-2517k2

Applications (1)Sample problems that can be solved with this function
Take a Tabular containing weather data:

https://wolfram.com/xid/01yw72zq9wi-qg5p9m

Analyze the tabular structure to find missing counts:

https://wolfram.com/xid/01yw72zq9wi-zej8f0

Transform missing in each column:

https://wolfram.com/xid/01yw72zq9wi-zf5zye

Wolfram Research (2025), TransformMissing, Wolfram Language function, https://reference.wolfram.com/language/ref/TransformMissing.html.
Text
Wolfram Research (2025), TransformMissing, Wolfram Language function, https://reference.wolfram.com/language/ref/TransformMissing.html.
Wolfram Research (2025), TransformMissing, Wolfram Language function, https://reference.wolfram.com/language/ref/TransformMissing.html.
CMS
Wolfram Language. 2025. "TransformMissing." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TransformMissing.html.
Wolfram Language. 2025. "TransformMissing." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TransformMissing.html.
APA
Wolfram Language. (2025). TransformMissing. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TransformMissing.html
Wolfram Language. (2025). TransformMissing. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TransformMissing.html
BibTeX
@misc{reference.wolfram_2025_transformmissing, author="Wolfram Research", title="{TransformMissing}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/TransformMissing.html}", note=[Accessed: 16-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_transformmissing, organization={Wolfram Research}, title={TransformMissing}, year={2025}, url={https://reference.wolfram.com/language/ref/TransformMissing.html}, note=[Accessed: 16-April-2025
]}