Pandas 分析不显示输出

Pandas Profiling doesn't display the output

早上好,

我有以下数据框:

print(df)

                  Company              ...      Sales
0                  Medi ltd.           ...      4.16000
1                  Pia  ltd.           ...      2.59907

[26958 rows x 15 columns]

但每当我 运行:

import pandas_profiling as pp
pp.ProfileReport(df)

它只是输出,没有情节或框架:

Out[92]: <pandas_profiling.ProfileReport at 0x1131e0668>

我尝试生成样本 df,但它也不起作用:

print(sample)

     Col1 Col2
Row1    1    2
Row2    3    4

我该如何解决这个问题?

答案供日后参考:

  • 这不是 pandas-profiling 特定问题。 Spyder 似乎确实在显示 HTML 方面存在问题,可以在此讨论中找到更多信息: https://github.com/spyder-ide/spyder/issues/4582

  • 一个快速的解决方法是将报告保存到一个文件中。你可以这样做:

report = pp.ProfileReport(df)
report.to_file('profile_report.html')

再次尝试安装 pandas 探查器和 运行 您的代码。