WOLFRAM

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

TransformMissing [tab,spec]

replaces instances of Missing [] in tabular data tab according to the specification spec.

TransformMissing [tab,{col1spec1,}]

uses the specification speci to replace missing elements in coli.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Column Specification  
Transformations  
Constant  
Random  
Position based  
Interpolation based  
Delete  
Options  
RandomSeeding  
Applications  
Possible Issues  
See Also
Related Guides
History
Cite this Page

TransformMissing [tab,spec]

replaces instances of Missing [] in tabular data tab according to the specification spec.

TransformMissing [tab,{col1spec1,}]

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
    TimeSeries [] a time series object
    EventSeries [] an event series 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 linear interpolation
    {"Interpolation",InterpolationOrder degree} 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.
  • Transformation based on missing data removal includes:
  • "Delete" remove the missing value
  • Deleting a missing value in a particular column will remove the whole row that value belongs to. »
  • 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)
  • The following options can be given:
  • RandomSeeding Automatic what seeding of pseudorandom generators should be done internally

Examples

open all close all

Basic Examples  (2)

Replace missing elements by using the mean value of the columns:

Wolfram Language code: data = Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]];
Wolfram Language code: TransformMissing[data, "Mean"]

Use a literal value:

Wolfram Language code: TransformMissing[data, {"Constant", 0}]

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

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "a" -> {"RandomVariate", NormalDistribution[_, _]}]

Scope  (18)

Column Specification  (4)

Transform the specified column:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "a" -> "Mean"]

Transform a list of columns:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], {"a" -> "Mean", "b" -> "Median"}]

Transform all the columns:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], All -> "Median"]

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

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["String" -> Association["ElementType" -> "String"], "Number" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{3, {0, 1, 1, 2}, "AC"}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/Q=="], "Capacity" -> 3, "BitCount" -> 2}] -> Missing[]}, "ElementType" -> "String"]], TabularColumn[Association["Data" -> {{1, 0, 3}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/Q=="], "Capacity" -> 3, "BitCount" -> 2}] -> Missing[]}, "ElementType" -> "Integer64"]]}}]]]], "Mean"]

This is equivalent to:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["String" -> Association["ElementType" -> "String"], "Number" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{3, {0, 1, 1, 2}, "AC"}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/Q=="], "Capacity" -> 3, "BitCount" -> 2}] -> Missing[]}, "ElementType" -> "String"]], TabularColumn[Association["Data" -> {{1, 0, 3}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/Q=="], "Capacity" -> 3, "BitCount" -> 2}] -> Missing[]}, "ElementType" -> "Integer64"]]}}]]]], Automatic -> "Mean"]

Transformations  (14)

Constant  (4)

Impute missing values with the mean of a column:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "Mean"]

Impute missing values with the median of a column:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "Median"]

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

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "Mode"]

Impute missing values with a constant value:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], {"a" -> {"Constant", -1}, "b" -> {"Constant", -1}, "c" -> {"Constant", 999}}]

Random  (2)

Impute each missing value with a random choice from its column:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "RandomElement"]

Sample from a given distribution:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], {"RandomVariate", NormalDistribution[]}]

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

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], {"RandomVariate", NormalDistribution[_, _]}]

Position based  (3)

Replace missing values using the previous non-missing value:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "PreviousElement"]

Replace missing values using the next non-missing value:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "NextElement"]

Replace missing values using the closest non-missing value:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "NearestElement"]

Interpolation based  (2)

Impute missing values sampling from an InterpolatingFunction :

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "Interpolation"]

Specify an interpolation order:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], {"Interpolation", InterpolationOrder -> 0}]

Delete  (3)

Remove missing values:

Wolfram Language code: TransformMissing[{1, 2, Missing[], 4}, "Delete"]

Remove rows with missing values in a column:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "b" -> "Delete"]

Remove rows with missing values in any column:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["a" -> Association["ElementType" -> "Integer64"], "b" -> Association["ElementType" -> "Integer64"], "c" -> Association["ElementType" -> "Real64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{1, 2, 3, 4, 0}, {}, DataStructure["BitVector", {"Data" -> ByteArray["7w=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, 2, 3, 4, Missing[]}]], TabularColumn[Association["Data" -> {{2, 0, 0, 5, 4}, {}, DataStructure["BitVector", {"Data" -> ByteArray["+Q=="], "Capacity" -> 5, "BitCount" -> 3}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {2, Missing[], Missing[], 5, 4}]], TabularColumn[Association["Data" -> {{0., 3.2, 6.1, 6.1, 7.8}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/g=="], "Capacity" -> 5, "BitCount" -> 4}] -> Missing[]}, "ElementType" -> "Real64", "CachedOriginalExpression" -> {Missing[], 3.2, 6.1, 6.1, 7.8}]]}}]]]], "Delete"]

Options  (1)

RandomSeeding  (1)

Specify a fixed seed for the pseudorandom generator:

Wolfram Language code: TransformMissing[{a, a, Missing[], b, a, b, Missing[], b, b, b}, "RandomElement", RandomSeeding -> 1234]

Applications  (1)

Take a Tabular containing weather data:

Wolfram Language code: data = ToTabular[TemporalData[Map[WeatherData["Chicago", #, {{2023, 12, 1}, {2023, 12, 3}}]&, obs = {"Temperature", "Pressure", "WindSpeed", "Visibility"}]], "TemporalData", Join[{"Time"}, obs]]

Analyze the tabular structure to find missing counts:

Wolfram Language code: TabularStructure[data]

Transform missing in each column:

Wolfram Language code: TransformMissing[data, {"Temperature" -> "Interpolation", "Pressure" -> "NearestElement", "WindSpeed" -> "PreviousElement", "Visibility" -> "Interpolation"}]

Possible Issues  (1)

Not all transformations are compatible with every data type:

Wolfram Language code: TransformMissing[Tabular[Association["RawSchema" -> Association["ColumnProperties" -> Association["String" -> Association["ElementType" -> "String"], "Number" -> Association["ElementType" -> "Integer64"]], "KeyColumns" -> None, "Backend" -> "WolframKernel"], "Options" -> {}, "BackendData" -> Association["ColumnData" -> DataStructure["ColumnTable", {{TabularColumn[Association["Data" -> {{3, {0, 1, 1, 2}, "AC"}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/Q=="], "Capacity" -> 3, "BitCount" -> 2}] -> Missing[]}, "ElementType" -> "String", "CachedOriginalExpression" -> {"A", Missing[], "C"}]], TabularColumn[Association[ "Data" -> {{1, 0, 3}, {}, DataStructure["BitVector", {"Data" -> ByteArray["/Q=="], "Capacity" -> 3, "BitCount" -> 2}] -> Missing[]}, "ElementType" -> "Integer64", "CachedOriginalExpression" -> {1, Missing[], 3}]]}}]]]], "String" -> "Mean"]
Wolfram Research (2025), TransformMissing, Wolfram Language function, https://reference.wolfram.com/language/ref/TransformMissing.html (updated 2026).

Text

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

CMS

Wolfram Language. 2025. "TransformMissing." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. 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

BibTeX

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

BibLaTeX

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

Top [フレーム]

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