Python 튜토리얼

Lv1 EDA 5/5 python 파이썬 결측치 확인하기(is_null() )

2021.06.11 09:52 9,443 Views

결측치(Missing Value)는 말 그대로 데이터에 값이 없는 것을 뜻합니다. 줄여서 'NA'라고 표현하기도 하고, 다른 언어에서는 Null 이란 표현을 많이 씁니다.

Pandas 에서는 결측치를 NaN 값으로 표현합니다.

Pandas에서 isnull() 메서드를 사용하면 DataFrame에서 NaN 값을 확인 할 수 있습니다.

isnull() 메소드는 Dataframe에서 데이터가 NaN 값이면 True로, 그렇지 않으면 False로 값을 리턴합니다.



import pandas as pd
import numpy as np

df = pd.DataFrame({
        'name': ['kwon', 'park', 'kim'],
        'age':[30, np.nan, 19],
        'class':[np.nan, np.nan, 1]
})

df.isnull()


그리고 isnull() 메서드 뒤에 sum() 메서드를 추가 해주면 데이터 프레임의 각 열 별 결측치의 수를 확인 할 수 있습니다.


import pandas as pd
import numpy as np

df = pd.DataFrame({
        'name': ['kwon', 'park', 'kim'],
        'age':[30, np.nan, 19],
        'class':[np.nan, np.nan, 1]

df.isnull().sum()



[Colab 실습 링크]


완료하신 분은 댓글에 done 이나 ✅ 이모지를 남겨주세요. 😉


Colaboratory 를 처음 접한 분은 👉 Colab 이란?


⬅️ Lv1 | EDA | 4/5 | 데이터 확인하기(head())

Lv1 | 전처리 | 1/2 | 데이터결측치확인하기(info()) ➡️

↩️ 오늘의 파이썬 리스트


👨‍💻데이스쿨 AI프로젝트👩🏻‍💻


#데이콘 #데이콘_101 #파이썬 #머신러닝 #딥러닝 #인공지능 #앙상블 #의사결정나무 #코랩 #데이터 #데이터분석 #판다스 #넘파이 #데이터사이언티스트 #AI #Python # Pandas #Numpy #lightgbm #read_csv #DACON #kaggle #sckit-learn

로그인이 필요합니다
0 / 1000
당쇠
2021.06.12 08:50

김상혁 12
2021.06.14 09:07

수면상태
2021.06.21 23:58

✅ 

캣니스
2021.06.26 11:12

kyeongsoo
2021.06.27 04:29

참치
2021.06.29 14:52

장대양봉
2021.06.29 16:57

done

ocial
2021.06.30 09:32

done

2021.06.30 15:50

우철
2021.06.30 15:51

쩐쭈나이차
2021.07.12 23:13

토스트
2021.07.16 17:07



vv00
2021.07.18 16:55

동그르르
2021.07.18 18:47

임노아
2021.07.19 16:55

done

김라바
2021.07.21 11:08

done

예온
2021.07.22 10:51

참치똥
2021.07.26 09:50

옐레나
2021.07.27 12:37

그린이
2021.07.27 15:19

징징E
2021.07.27 16:55

ㅅㅇㅅㅇ
2021.07.30 13:13

도란도란
2021.07.31 00:36

도란도란
2021.07.31 00:44

삭제된 댓글입니다

놀란햄스터
2021.07.31 21:38

정장입고시퍼요
2021.08.02 14:47

dazzi
2021.08.02 20:37

분석을할상인가
2021.08.03 13:55

힝잉잉이
2021.08.04 00:02

done

두두두두두두
2021.08.05 16:11

hansarami
2021.08.12 00:40

done

테라스
2021.08.12 12:34

비회원
2021.08.12 20:04

해만이
2021.08.16 00:58

아아유진
2021.08.20 01:04


뿌요
2021.08.22 17:38

주주리
2021.08.22 21:44

물빛반짝
2021.08.24 16:36

minakusi
2021.08.26 13:55

SeoyeonLee
2021.08.31 16:13

 ✅ 

B-Jay
2021.08.31 20:08

그린티
2021.09.02 10:48

zzzzzih
2021.09.02 15:07

done

꿀막
2021.09.02 20:54

Willbee
2021.09.03 03:35

done

FuTheze
2021.09.05 14:37

지내니
2021.09.07 10:19

 ✅

서승현
2021.09.07 23:21

 ✅

pk38909
2021.09.08 13:30

done

DSJY
2021.09.08 15:29

다욤
2021.09.12 18:16

모모13
2021.09.15 12:15

Solhong
2021.09.16 18:03

exception
2021.09.20 15:57

지내니
2021.09.21 10:30

찬찬이
2021.09.23 16:16

Arniel
2021.09.24 19:43

done

neppy
2021.09.26 19:05

done

Dataseeker
2021.09.28 09:39

진리의 탐구자
2021.09.28 11:32

done

changhyeon
2021.09.28 15:36

done

향기
2021.09.29 15:37

Holte
2021.09.30 00:28

✅ 

ikmarch28
2021.10.01 13:06

줌돌
2021.10.03 22:54

쇠질하는코린이
2021.10.05 14:49

done

데자와
2021.10.09 13:15

junghyuntaek
2021.10.09 15:01

HU
2021.10.09 18:58

MINGAHAHA
2021.10.25 16:03

왼쪽눈썹왁싱
2021.10.26 16:05

cori
2021.10.30 19:54

done

코딩코기
2021.10.31 12:30

done

이대권
2021.10.31 12:34

cberrys
2021.11.02 22:32

가르치조림
2021.11.04 09:54

print('\n--------------------------------train.csv 각 열 별 결측치 수--------------------------------\n')
print(test.isnull().sum())

이부분이 수정되어야 할것 같습니다.  train.isnull().sum()으로~!

mage
2021.11.05 00:15

done

꾸니
2021.11.09 17:47

농사꾼
2021.11.10 15:42

11.10

coddinggoldfish
2021.11.11 13:26

DDoS
2021.11.15 21:45

mission clear project

아자액션가면
2021.11.16 11:47

yulia.
2021.11.16 18:26

breaktime
2021.11.23 15:56

히9
2021.11.24 17:09

gpflr
2021.11.26 16:02

done

sunnydays
2021.11.27 12:13

순무
2021.11.30 22:25

jbsh_MAD_SAIKYO
2021.12.01 11:57

비회원
2021.12.01 23:07

😉

Hod0ri
2021.12.03 18:37

지금노플
2021.12.06 17:52

sotanfdl
2021.12.08 18:52

주주리
2021.12.12 23:23

GOKILDONG
2021.12.13 10:09

done

Soohobi
2021.12.13 17:35

baby_perm
2021.12.13 18:53

done

ark2300
2021.12.14 15:37

hyogyun
2021.12.15 13:26

하랴랴
2021.12.15 17:54

MMMMMMMMMMMMMMMMMMMM
2021.12.16 20:52

done

녹삭
2021.12.18 09:28

단발토끼쓰
2021.12.18 13:01

moran
2021.12.20 14:08

마앙고
2021.12.24 23:51

s_nana
2021.12.27 22:10

쫄쫄
2021.12.28 16:11

✅ v

츠무
2021.12.28 16:52

암냠냠
2021.12.29 00:36

done

cm
2021.12.30 20:25

자퇴생
2022.01.01 23:48

done

글월
2022.01.03 17:25

done

yongE
2022.01.04 03:46

done

benelli
2022.01.05 00:28

done

201702018
2022.01.05 16:08

hijihyo
2022.01.07 00:37

done

jj150618
2022.01.09 02:58

djffjdEndEkd
2022.01.12 23:49

done

dbnoid
2022.01.13 13:27

✅ 

inuin
2022.01.13 13:30

done

isoy
2022.01.13 19:00

done

소로소솜
2022.01.17 13:44

햄이
2022.01.20 00:56

done

bluemk00
2022.01.21 22:11

done

minelolo
2022.01.24 21:27

done

곽진섭
2022.01.24 22:56

done

호랭이띠
2022.01.25 10:48

재키
2022.01.27 11:39

done

해달이
2022.02.04 21:54

done

cococosy
2022.02.05 12:22

done

powerwook
2022.02.07 19:06

✅ 

mansig
2022.02.08 12:07

요공만
2022.02.08 15:09

찹쌀아빠
2022.02.09 18:34

daehan
2022.02.09 21:49

될때까지간다리
2022.02.09 23:52

일렁
2022.02.12 16:16

동도서기
2022.02.12 22:51

✅ 

준용_Choi
2022.02.17 01:27

done

navy
2022.02.17 21:04

구Dok
2022.02.19 19:40

땅콩누나
2022.02.19 22:38

YGstar
2022.02.21 22:59

done

Mc_col
2022.02.27 04:22

코랩코드 정답 잘못된것같네요

으아아아악
2022.03.08 23:33

piape
2022.03.10 16:58

acebed
2022.03.10 17:57

done

민균
2022.03.11 19:13

done

하얀레몬
2022.03.13 16:07

done

kimgugu
2022.03.15 12:24

졔이
2022.03.16 22:23

이다다
2022.03.18 21:54

done

Bsh
2022.03.19 03:00

done

jos0213
2022.03.30 00:57

done

비회원
2022.04.05 11:58

Kdata
2022.04.05 17:27

pineapple
2022.04.09 23:31

온조
2022.04.14 13:33

done

LS
2022.04.15 00:24

done

위지
2022.04.19 12:32

done

즈즈
2022.04.20 01:32

done

닥터페퍼마시따
2022.04.21 17:07

코딩백수
2022.04.21 17:18

done

지모
2022.04.27 23:12

done

argonaise
2022.04.28 16:34

보일러
2022.05.10 21:16

미키
2022.05.11 08:25

pp.m
2022.05.12 12:27

rkdls
2022.05.12 18:40

done

deus_ex_marchina
2022.05.13 18:40

Jay0329
2022.05.18 23:46

krooner
2022.05.19 11:16

두콩
2022.05.19 19:39

done

린스바른빡빡이
2022.05.20 12:18

yell
2022.05.21 06:34

done

그린이
2022.05.25 08:28

khloee
2022.05.26 14:13

김현배
2022.05.26 16:34

라다나가
2022.05.29 21:51

트세연
2022.06.02 17:01

jaka
2022.06.05 14:22

kreimben
2022.06.18 17:16

살랑
2022.06.20 21:51

레디미르
2022.06.22 17:44

빠앙
2022.06.23 16:17

done

샤돌
2022.06.24 04:00

done

효삼
2022.06.27 14:48

done 

dnd404
2022.06.29 14:41

KHK
2022.06.29 18:29

done

rhkdgml
2022.06.30 14:19

3351
2022.06.30 14:28


돈벌자
2022.07.03 20:14

done

Y2J
2022.07.04 15:33

✅ 

MINKYU
2022.07.18 18:02

nigel
2022.07.21 09:49

dnwne
2022.07.21 15:43

두루미야
2022.07.21 23:17

whdgus928
2022.07.25 13:52

done

forest_yoon
2022.07.26 05:19

slave
2022.07.29 11:37

남재은
2022.08.02 20:25

 ✅

김귤
2022.08.04 16:38

SauberHands
2022.08.07 15:09

Kims96
2022.08.08 14:39

간지나는패션
2022.08.09 14:55

done

ai_pedagogy
2022.08.11 15:17

😀

C_YunJu
2022.08.12 16:34

✅ 

growleb
2022.08.22 21:43

굿전
2022.08.29 09:59

완료

귤이조아
2022.08.29 23:48

skanehfud279
2022.09.07 10:51

done

pysung
2022.09.07 12:53

done

재상쓰
2022.09.15 10:49

done

나중에보자
2022.09.18 18:13

done

kevinlee
2022.09.20 18:31

리카루스
2022.09.23 17:11

done

hugo_o
2022.09.24 15:29

도비콘
2022.09.24 15:30

👍

baeksh0330
2022.09.24 15:33

도비콘
2022.09.24 15:34

🤜🏻🤛🏽

새봄
2022.09.24 23:43

지수98
2022.09.29 18:22

플랏
2022.10.01 19:22

done

Tica
2022.10.04 19:12

엿장수
2022.10.10 15:30

긍정의힘
2022.10.12 20:32

고구마망
2022.10.18 10:08

🍠

gnt0000
2022.10.27 00:41

yun_
2022.10.28 23:07

done

sk100
2022.10.31 18:01

done

nImoS
2022.10.31 23:10

 ✅

미스터사이공
2022.11.05 11:56

keogh
2022.11.07 23:41

SHL
2022.11.10 18:34

done

타콕
2022.11.14 20:52

done

DACON.SP
2022.11.18 16:05

savvyall
2022.11.28 11:27

done

하이랑
2022.12.26 00:40

너도
2022.12.26 15:27

zeus999
2023.01.01 16:39

웅버
2023.01.04 16:18

유정잉
2023.01.04 17:23

다모
2023.01.05 17:23

ickhwan
2023.01.08 22:13

highllight
2023.01.11 16:17

ml.gil
2023.01.18 13:35

저예요저
2023.02.24 10:38

✅ 

래시포드
2023.03.06 17:02

johnchoi44
2023.06.02 11:55

done

jws9490
2023.07.03 17:44

done

대장고양이샤샤
2023.10.20 20:54

 ✅

이믄서
2024.01.09 22:44