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
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
2022-8-5
idx = isnan(c.lagpe); % find the index of nan
c(idx, :) =[]; % remove the rows from table
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numeric Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!