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!