there is nan in a column, delete the whole row

1 Ansicht (letzte 30 Tage)
King To Leung
King To Leung am 5 Aug. 2022
Kommentiert: Walter Roberson am 5 Aug. 2022
I have a data base called data_crsp, and there might be some nan values in c.lagpe column (column 18), I want the whole row of data to be romoved if there is nan in column 18.
Thanks in advance!
  2 Kommentare
the cyclist
the cyclist am 5 Aug. 2022
I'm confused, because you refer to a "data base" data_crsp, but that's not a MATLAB object type.Then you refer to c.lagpe, but it's not clear what c is.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Chunru
Chunru am 5 Aug. 2022
idx = isnan(c.lagpe); % find the index of nan
c(idx, :) =[]; % remove the rows from table

Weitere Antworten (0)

Kategorien

Mehr zu Numeric Types finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by