Delete rows with NaN records
古いコメントを表示
How can I delete rows which have NaN on one of the column.
採用された回答
その他の回答 (3 件)
Chris Turnes
2017 年 3 月 7 日
5 投票
Not that this question needed another answer, but, you can also check out the rmmissing function that was introduced in R2016b. If you combine this with standardizeMissing, you can convert your 'GNAs' strings to a standard missing indicator, and then remove the rows with rmmissing.
carmen
2012 年 3 月 12 日
check out the isnan() functioion. the following code looks like a workaround but it works:
A=[1 2 3;nan 4 5;nan 6 nan];
B=A(sum(isnan(A),2)==0);
B %returns the only nan-free row of A: [1 2 3]
hf
1 件のコメント
A=[1 2 3;nan 4 5;nan 6 nan]
B=A(sum(isnan(A),2)==0,:);
B %returns the only nan-free row of A: [1 2 3]
Manuel Aboy
2022 年 12 月 28 日
0 投票
mpg = mpg(~ismissing(mpg));
カテゴリ
ヘルプ センター および File Exchange で Data Type Identification についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!