C.W.K.
Stream
Lesson 03 of 06 · published

데이터 Profiling — 검증 전에 데이터 알기

~10 min · profiling, exploration, ydata-profiling

Level 0구경꾼
0 XP0/47 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

Profile 안 한 거 검증 못 해

Schema 검증은 데이터 모양 진짜 알 때 가장 유용해. Profiling — 요약 통계, 분포, 결측 패턴, 상관관계, 이상치 만드는 자동화된 탐색 분석 — 이 좋은 검증을 가능하게 하는 upstream 활동. 먼저 profile, 그리고 본 거 기반으로 schema 작성.

Profiling 의 두 풍미

  • 수동 / 빠른df.describe(), df.info(), df.isna().mean(), df['col'].value_counts(dropna=False). 일상의 근육 기억.
  • 자동 리포트ydata-profiling (구 pandas-profiling) 이 type 탐지, 분포, 상관, 결측 패턴, 경고 있는 인터랙티브 HTML 리포트 생성. 데이터 안 본 동료에게 profile 넘기기 유용.

Code

일상의 빠른 profile snippet·python
import pandas as pd

def quick_profile(df: pd.DataFrame) -> None:
    print(f'shape: {df.shape}')
    print(f'memory: {df.memory_usage(deep=True).sum() / 1e6:.2f} MB')
    print()
    print('dtypes:')
    print(df.dtypes)
    print()
    print('missingness:')
    print((df.isna().mean().sort_values(ascending=False).head(10) * 100).round(2).to_string())
    print()
    print('cardinality (unique counts):')
    print(df.nunique().sort_values().head(10).to_string())
    print()
    print('numeric describe:')
    print(df.describe(include='number').T.head(10).to_string())

quick_profile(orders_df)
ydata-profiling — 한 번 호출로 전체 HTML 리포트·python
from ydata_profiling import ProfileReport

profile = ProfileReport(orders_df,
                        title='Orders profile (2026-04-30)',
                        minimal=False,           # 큰 DataFrame 엔 True
                        explorative=True)
profile.to_file('reports/orders_profile.html')

External links

Exercise

최소 50,000 row, 10 column DataFrame 골라. Quick-profile snippet 돌려. surprise 한 거 셋 메모. 그리고 ydata-profiling 돌리고 HTML 리포트 열기. 두 개 비교 — quick-profile 이 일상 반사, ydata 가 동료와 공유 필요할 때 deep dive.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.