谷歌colab中的Pandas分析错误

Ahm*_*nis 4 python data-analysis pandas google-colaboratory

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

 import pandas_profiling
 profile = pandas_profiling.ProfileReport(df)
Run Code Online (Sandbox Code Playgroud)

并得到该错误:

" concat() got an unexpected keyword argument 'join_axes' "
Run Code Online (Sandbox Code Playgroud)

小智 5

好吧,我也经历过这个问题并以某种方式尝试解决它,所以让我回答这个问题

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

! pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip 
Run Code Online (Sandbox Code Playgroud)

第 2 步:输入以下内容重新启动内核

import os
os._exit(00)
Run Code Online (Sandbox Code Playgroud)

第 3 步:导入库

import pandas as pd
import pandas_profiling
from pandas_profiling import ProfileReport 
Run Code Online (Sandbox Code Playgroud)

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

df=pd.read_csv('path of csv file') 
Run Code Online (Sandbox Code Playgroud)

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

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