파이썬 코드 단 세 줄로 EDA Report 만들기 | Yoon's Lab Note

파이썬 코드 단 세 줄로 EDA Report 만들기

Preview


간단한 코드로 쉽고 편리한 EDA Report를 제공하는 EDA TOOL, Pandas Profiling을 알아보자


Introduction

세상에는 탐색적 데이터 분석(EDA)를 수행하는 방법들이 수 없이 많지만, Pandas Profiling 만큼 쉽고 빠르고 양질의 구성을 제공하는 패키지는 흔치않다.

특히나 EDA에 소요되는 시간을 획기적으로 줄여줄 뿐만 아니라 오픈소스로에다, 반응형 웹 HTML 파일로 서비스 확장까지 가능한 EDA TOOL이다.

샘플 코드

백문이 불여 일타라고 간단한 샘플 코드부터 살펴보면

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pandas as pd
#!pip install pandas-profiling
from pandas_profiling import ProfileReport

# Pandas로 데이터 로드
df = pd.read_csv('path/to/data')

# EDA Report 생성
profile = ProfileReport(df,
            minimal=False,
            explorative=True,
            title='Data Profiling',
            plot={'histogram': {'bins': 8}},
            pool_size=4,
            progress_bar=False)

# Report 결과 경로에 저장
profile.to_file(output_file="data_profiling.html")

상세 옵션은 여기에서 확인 가능하다.

주요 기능 (결과 확인)

Overview

Preview

Variables

Preview

Interactions

Preview

Correlations

Preview

Missing Values

Preview

Samples

Preview

References


0%