EDA是数据分析必须的过程,用来查看变量统计特征,可以此为基础尝试做特征工程。
1. Pandas_Profiling
这个属于三个中最轻便、简单的了。它可以快速生成报告,一览变量概况。首先,我们需要安装该软件包。
# 安装Jupyter扩展widget
jupyter nbextension enable --py widgetsnbextension
# 或者通过conda安装
conda env create -n pandas-profiling
conda activate pandas-profiling
conda install -c conda-forge pandas-profiling
# 或者直接从源地址安装
pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip
安装成功后即可导入数据直接生成报告了。
import pandas as pd
import seaborn as sns
mpg = sns.load_dataset('mpg')
mpg.head()
from pandas_profiling import ProfileReport
profile = ProfileReport(mpg, title='MPG Pandas Profiling Report', explorative = True)
profile
使用Pandas Profiling生成了一个快速的报告,具