Notice
Recent Posts
Recent Comments
Link
«   2026/03   »
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
Tags
more
Archives
Today
Total
관리 메뉴

빈틈

EDA 본문

data

EDA

prs21 2023. 5. 14. 16:34

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