Effacer les filtres
Effacer les filtres

there is nan in a column, delete the whole row

1 vue (au cours des 30 derniers jours)
King To Leung
King To Leung le 5 Août 2022
Commenté : Walter Roberson le 5 Août 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 commentaires
the cyclist
the cyclist le 5 Août 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.
Walter Roberson
Walter Roberson le 5 Août 2022

Connectez-vous pour commenter.

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by