Pandas 결측치 포함된 행 제거

(Pandas 결측치 가진 행 제거에서 넘어옴)

1 개요[ | ]

Pandas 결측치 가진 행 제거

2 예시 1[ | ]

import numpy as np
import pandas as pd

df = pd.DataFrame({"name": ['Alfred', 'Batman', 'Catwoman'],
                   "toy": [np.nan, 'Batmobile', 'Bullwhip'],
                   "born": [pd.NaT, pd.Timestamp("1940-04-25"),
                            pd.NaT]})
df
df.dropna()

3 예시 2[ | ]

import pandas as pd

df = pd.DataFrame(columns =
  ['Name' ,'English','Math'], data = [
  ['Alice', 90      , 60   ],
  ['Bob'  , 80      , None ],
  ['Carol', None    , 80   ],
  ['Dave' , 60      , 80   ],
  ['Erwin', 85      , 85   ],
  ])
df
df.dropna()


4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}