从技术上讲,我已经使用安装了 pandas-profiling
pip install pandas-profiling
但是当我尝试导入它时,出现以下错误:
import numpy as np
import pandas as pd
import pandas_profiling
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-e1a23f2a6f04> in <module>()
1 import numpy as np
2 import pandas as pd
3 import pandas_profiling
ModuleNotFoundError: No module named 'pandas_profiling'
Run Code Online (Sandbox Code Playgroud)
所以我尝试将其安装在 Jupyter Notebook 中,也收到以下错误:
import sys
!{sys.executable} -m pip install pandas-profiling
Collecting pandas-profiling
Could not find a version that satisfies the requirement pandas-profiling
(from versions: )
No matching distribution found for pandas-profiling
Run Code Online (Sandbox Code Playgroud)
我也无法使用 conda …
我想使用 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”
我希望删除 pandas-profiling HTML 报告中“概述”选项卡下的“警告”和“复制”菜单选项/选项卡。

我们希望将其集成到我们的应用程序中,以展示对数据集的基本了解。我们希望删除我们的要求的警告。
我正在对我的数字数据进行探索性数据分析,我尝试运行 Pandas 分析,但在生成报告结构时出错。
import pandas as pd
from pandas_profiling import ProfileReport
df = pd.read_csv('mydatadata.csv')
print(df)
profile = ProfileReport(df)
profile.to_file(output_file="mydata.html")
Run Code Online (Sandbox Code Playgroud)
错误日志看起来像这样
总结数据集:99%|????????????????????????????????????????????? ?????????????????????????????????| 1144/1150 [46:07<24:03, 240.60s/it, 计算cramers相关性]C:\Users\USER\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas_profiling\model\correlations. py:101: UserWarning: 曾尝试计算克拉默相关性,但失败了。要隐藏此警告,请禁用计算(使用
df.profile_report(correlations={"cramers": {"calculate": False}})如果这对您的用例有问题,请将其报告为问题:https : //github.com/pandas-profiling/pandas-profiling/issues(包括错误消息:'没有数据;observed大小为 0.') warnings.warn( 汇总数据集:100%|????????????????????????????????????? ???????????????????????????????????????????????????| 1145/1150 [46:19<17:32, 210.49s/it, Get scatter matrix]位图分配失败
如果有人尝试过pandas-profiling 包,请帮助我提供任何有关使其运行得更快的见解。包的输出报告非常整洁和详细,但即使使用中等大小的数据集,创建报告也需要很长时间。Kaggle bulldozers 数据集中大约 10 列和 400K 行花费了 21 分钟(非 GPU)。想知道是否值得进一步调查。
df.shape
(401125, 9)
start = datetime.datetime.now()
profile = df.profile_report(title="Exploring Dataset")
profile.to_file(output_file=Path("./data_report.html"))
end = datetime.datetime.now()
print(end-start)
0:21:23.976324
Run Code Online (Sandbox Code Playgroud) 我正在使用google colab进行编程。我只是想知道我使用的是哪个版本的 pandas_profiling 包。
我尝试了以下选项。他们都没有工作。
pandas_profiling.__version__pandas_profiling.version__version__pandas.show_versions()我只是想让你知道,我正在使用 Pandas1.0.3版本。
有人可以帮我解决这个问题吗?
当在数据帧上运行 pandas-profiling 时,我看到它将索引分析为变量。注意:我的索引是唯一键(名为UUID)
有没有办法排除引入索引来报告?
我知道我可以在 pandas 中删除它,但在我的脑海中我想做
ProfileReport(df, use_index=False)
每次我在不同的数据集中使用 pandas 分析时,笔记本都会显示此错误。
IndexError:只有整数、切片 (
:)、省略号 (...)、numpy.newaxis (None) 和整数或布尔数组是有效索引。
import pandas as pd
df = pd.read_csv('H:\DATA Sets\cereal.csv')
from pandas_profiling import ProfileReport
profile = ProfileReport(df,title='cereal-eda',html={'style' : {'full_width':True}})
Run Code Online (Sandbox Code Playgroud)
使用的数据集 - 来自kaggle的gray.csv https://www.kaggle.com/crawford/80-cereals