import sweetviz as sv #Generating Sweetviz report report = sv.analyze(df) report.show_html("iris_EDA_report.html") # specify a name for the report
这就是典型的 Sweetviz 报告的样子确实令人印象深刻和漂亮。
3. AutoViz
AutoViz 只需一行代码即可快速分析任何数据。要安装库,与以上类似。
from autoviz.AutoViz_Class import AutoViz_Class AV = AutoViz_Class() #Generating AutoViz Report #this is the default command when using a file for the dataset filename = "" sep = "," dft = AV.AutoViz( filename, sep=",", depVar="", dfte=None, header=0, verbose=0, lowess=False, chart_format="svg", max_rows_analyzed=150000, max_cols_analyzed=30, )
由于我们使用的是库中的数据集,我们需要如下修改
#Generating AutoViz Report filename = ""# empty string ("") as filename since no file is being used for the data sep = "," dft = AV.AutoViz( '', sep=",", depVar="", dfte=df, header=0, verbose=0, lowess=False, chart_format="svg", max_rows_analyzed=150000, max_cols_analyzed=30, )