Pandas 分析错误 AttributeError:“DataFrame”对象没有属性“profile_report”

Adh*_*ish 5 python-3.x pandas pandas-profiling

我想使用 pandas-profiling 对数据集进行一些 eda,但收到错误: AttributeError: 'DataFrame' object has no attribute 'profile_report'

我在spyder上创建了一个python脚本,代码如下:

import pandas as pd
import pandas_profiling
data_abc = pd.read_csv('abc.csv')
profile = data_abc.profile_report(title='Pandas Profiling Report')
profile.to_file(output_file="abc_pandas_profiling.html")
Run Code Online (Sandbox Code Playgroud)

AttributeError:“DataFrame”对象没有属性“profile_report”

Rob*_*gat 5

df.profile_report()入口点从 v2.0.0 开始可用。索尔从这里

您是否通过 pip 或 conda 安装了 pandas-profiling?

使用: pip install -U pandas-profiling 解决这个问题并重新启动内核


Adh*_*ish 0

我发现的唯一解决方法是我制作的 python 脚本是从命令提示符执行并给出正确的输出,但代码在 Spyder 中仍然给出错误。