Missingno를 먼저 설치해줍니다. conda install -c conda-forge missingno 라이브러리를 import 해주고 import missingno as msno 결측값 확인 (Matrix) : NaN의 분포 msno.matrix(df=df_train.iloc[:,:], figsize=(8,8), color=(0.8, 0.5, 0.2)) 결측값 확인 (Bar) : NaN % msno.bar(df=df_train.iloc[:,:], figsize=(8,8), color=(0.8, 0.5, 0.2)) p.s. 데이터 넘기는 인수에 굳이 df_train.iloc[:,:] 안적고 그냥 df_train 적어도 된다. 결국에는 그냥 데이터 전부 넘기겠습니다 의미기 때문 참고 : https:/..
데이터를 살펴 볼 때 유용하다. for col in df_train.columns: msg = 'column : {:>10}\t Percent of NaN value : {:.2f}%'.format(col, 100*(df_train[col].isnull().sum()/df_train[col].shape[0])) print(msg) df_train 에서 col을 하나씩 뽑는다. df_train[col].isnull() 하면 Null 인지 아닌지 True 와 False로 하나씩 뽑는다. 합치면 True의 갯수만 나온다. (True면 Null) df_train[col].shap[0] 하면 전체 행의 갯수를 알려준다. ( df_train[col].isnull().sum() / df_train[col].shape..