필터 지우기
필터 지우기

there is nan in a column, delete the whole row

조회 수: 1 (최근 30일)
King To Leung
King To Leung 2022년 8월 5일
댓글: Walter Roberson 2022년 8월 5일
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