본문 바로가기
2/[ Python ]

Pandas - Dropna Function

by Kieran_Han 2020. 11. 28.

df.dropna( )

    df에 NaN 값이 있으면 해당 row 통째로 제거

df.dropna(how='all')

    모든 row가 NaN일때만 row 제거

df.dropna(axis=1)

df.dropna(axis=1, how='all')

    default가 row이므로 axis를 column으로 변경

df.dropna(thresh=n)

    각 row에서 NaN이 아닌 값이 최소 n개보다 적으면 해당 row 제거

' > [ Python ]' 카테고리의 다른 글

iloc, loc Function  (0) 2020.12.07
Best Practices with Pandas  (0) 2020.11.28
Pandas - DataFrame 원하는 조건으로 조회  (0) 2020.11.27
Pandas - Sample Function  (0) 2020.11.27
Top 25 pandas tricks  (0) 2020.11.27