there is nan in a column, delete the whole row

1 次查看(过去 30 天)
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 个评论
the cyclist
the cyclist 2022-8-5
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.

请先登录,再进行评论。

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numeric Types 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by