빈틈
EDA 본문
1. 사분위수 도출 및 이상치 검출
# 사분위수 도출 및 이상치 검출
Q1 = df["컬럼명"].quantile(.25)
Q2 = df["컬럼명"].quantile(.5)
Q3 = df["컬럼명"].quantile(.75)
IQR = Q3 - Q1
condition1 = df["컬럼명"] > (Q3 + IQR * 1.5)
upperOuter = df[condition]
condition2 = df["컬럼명"] < (Q1 - IQR * 1.5)
lowerOuter = df[condition]
print(lowerOuter)
print(upperOuter)
2. 중복값 확인 / 제거
중복값 확인 : df.duplicated()
중복값 제거 : df.drop_duplicates('컬럼명')
- 옵션 : keep='first' | 'last'
3. 결측치 제거 : dropna()
dropna(axis=0) : 결측치 행 전체 삭제
dropna(axis=1) : 결측치 열 삭제
'data' 카테고리의 다른 글
| Machine Leanring (0) | 2023.05.17 |
|---|---|
| 통계 라이브러리 (0) | 2023.05.17 |
| Numpy & Pandas (0) | 2023.05.14 |