timetable.ismissing
timetable: TF = ismissing (tt)
timetable: TF = ismissing (tt, indicator)
Find missing values in the variables of a timetable.
TF = ismissing (tt) returns a logical array with one
row per row of tt and one column per variable, true where the
variable is missing there. What counts as missing depends on the type:
NaN for numeric data, NaT for datetime,
<undefined> for categorical, and an empty character
vector or string.
The row times are not read. They label the rows rather than being one
of them, so a missing row time is not reported here and does not make
anymissing true. rmmissing does drop such a row, being
about what can be kept rather than about what is missing.
TF = ismissing (tt, indicator) treats the
values in indicator as missing as well.
See also: anymissing, rmmissing, standardizeMissing, timetable
Source Code: timetable
ismissing marks the missing values of each variable, one column per variable and one row per row. What counts as missing depends on the type: NaN for numbers, NaT for datetimes, an empty string for text.
t0 = datetime (2024, 1, 1);
Depth = [12; 45; NaN];
Site = {'N'; ''; 'S'};
TT = timetable (Depth, Site, 'RowTimes', t0 + hours (0:2)')
TT =
3x2 timetable
Time Depth Site
____________________ _____ _____
01-Jan-2024 00:00:00 12 {'N'}
01-Jan-2024 01:00:00 45 {'' }
01-Jan-2024 02:00:00 NaN {'S'}
ismissing (TT)
ans = 0 0 0 1 1 0
The row times are not read: they label the rows rather than being one of them. A second argument names further values to treat as missing.
ismissing (TT, 45)
ans = 0 0 1 0 0 0