일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- 머신러닝
- 사이킷런
- computer vision
- KNeighborsClassifier
- opencv
- 결측치
- mask detection
- pandas
- Deep learning
- Supervised learning
- 비트와이즈
- 파이썬
- dropna
- 판다스
- index
- NAN
- NULL
- 이미지처리
- Python
- 알파브렌딩
- sklearn
- 이미지프로세싱
- dataframe
- ML
- k-최근접 이웃 분류
- scikit-learn
- 지도학습
- 데이터프레임
- tfidfvectorizer
- 결측값
- Today
- Total
목록dropna (2)
Sun.El Data Analysis

데이터 프레임 내에서 결측값을 확인하고 처리하기 1. 데이터 확인하기[IN]import pandas as pdimport seaborn as snsimport numpy as npdf = sns.load_dataset('planets')df.head(10) [OUT]method number orbital_period mass distance year0 Radial Velocity 1 269.300 7.10 77.40 20061 Radial Velocity 1 874.774 2.21 56.95 20082 Radial Velocity 1 763.000 2.60 19.84 20113 Radial Velocity 1 326.030 19.40 110.62 20074 Radial Velocity 1 516.220 ..

1. 결측값이 하나라도 있는 모든 행 삭제 df1 = df.dropna() #axis=0 기본값 df1 = df.dropna(axis=0) df1 = df.dropna(axis='index') 2. 결측값이 하나라도 있는 모든 열 삭제 df1 = df.dropna(axis=1) df1 = df.dropna(axis='columns') 3. 특정 칼럼에 결측값이 하나라도 있을 시 모든 행 삭제 df1 = df.dropna(subset=['animal']) df1 = df.dropna(subset=['animal'], how='any') 3. 전체 행/열이 결측값인 행/열 삭제 : how = 'all' df1 = df.dropna(axis=0, how='all') df1 = df.dropna(axis=1, ..