standardizeMissing
Insert standard missing values
Description
replaces values specified in B
= standardizeMissing(A
,indicator
)indicator
with standard missing values in
A
and returns a standardized array or table.
Missing values are defined according to the data type of
A
:
NaN
—double
,single
,duration
, andcalendarDuration
NaT
—datetime
<missing>
—string
<undefined>
—categorical
{''}
—cell
of character vectors
If A
is a table, then the data type of each variable defines the
missing value for that variable.
In addition to standardizing missing values, you can interactively find, fill, or remove missing data by adding the Clean Missing Data task to a live script.
specifies additional parameters for standardizing missing values using one or more
name-value arguments. For example,
B
= standardizeMissing(___,Name,Value
)standardizeMissing(A,indicator,'DataVariables',datavars)
standardizes
missing values in the variables specified by datavars
when
A
is a table or timetable.
Examples
Input Arguments
Algorithms
standardizeMissing
treats leading and trailing
white space differently for cell arrays of character vectors, character
arrays, and categorical arrays.
For cell arrays of character vectors,
standardizeMissing
does not ignore white space. All character vectors must match exactly a character vector specified inindicator
.For character arrays,
standardizeMissing
ignores trailing white space.For categorical arrays,
standardizeMissing
ignores leading and trailing white space.
Alternative Functionality
Live Editor Task
In addition to standardizing missing values, you can interactively find, fill, or remove missing data by adding the Clean Missing Data task to a live script.