【问题标题】:Pandas Profiling error within google colab谷歌 colab 中的 Pandas 分析错误
【发布时间】:2020-04-18 02:01:50
【问题描述】:

我正在尝试在我的 Google Colab 笔记本中使用 Pandas_Profiling.ProfilingReport。这是我的代码:

 import pandas_profiling
 profile = pandas_profiling.ProfileReport(df)

然后得到那个错误:

" concat() got an unexpected keyword argument 'join_axes' "

【问题讨论】:

  • 您介意添加 pd.__version__ 和 pandas_profiling_version 吗?

标签: python pandas google-colaboratory data-analysis


【解决方案1】:

好的,我也经历过这个问题,并试图解决它,所以让我来回答这个问题

步骤: 第 1 步:运行此命令

! pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip 

第 2 步:键入重新启动内核

import os
os._exit(00)

第 3 步:导入库

import pandas as pd
import pandas_profiling
from pandas_profiling import ProfileReport 

第 4 步:导入并读取您的 csv 文件

df=pd.read_csv('path of csv file') 

第 5 步:定义您的个人资料报告并将其保存在 HTML 文档中

profile = ProfileReport(df, title="data set", html={'style' : {'full_width':True}})
profile.to_file(output_file="name of html file.html") 

【讨论】:

  • 谢谢!这对我有用,我能够得到一份不错的报告。节省了我的时间。
【解决方案2】:

不幸的是,谷歌 colab 中安装的 pandas 版本不推荐使用“join_axes”功能。如果您降级 pandas 库版本,您可以使用 Pandas Profiling。只需在您的 colab 中使用:

! pip install pandas==0.25

然后重启内核!

但是,您将无法使用

profile = ProfileReport(df, title="Pandas Profiling Report")
profile.to_widgets()

因为 Google Colab 还不支持 ipywidgets。但如果你只是使用

profile

你会得到一份报告

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多