Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandas Profiling error within google colab

I'm trying to use Pandas_Profiling.ProfilingReport within my Google Colab notebook. This is my code:

 import pandas_profiling
 profile = pandas_profiling.ProfileReport(df)

and get that error:

" concat() got an unexpected keyword argument 'join_axes' "
like image 495
Ahmed Younis Avatar asked Aug 31 '25 10:08

Ahmed Younis


2 Answers

Okha I have also gone through this issue and somehow tried to resolve it, so let me answer this question

Steps : Step 1 : Run this command

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

Step 2 : Restart the kernel by typing

import os
os._exit(00)

Step 3 : Import the libraries

import pandas as pd
import pandas_profiling
from pandas_profiling import ProfileReport 

Step 4 : Import and read your csv file

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

Step 5 : Define your profile report and save it in a HTML document

profile = ProfileReport(df, title="data set", html={'style' : {'full_width':True}})
profile.to_file(output_file="name of html file.html") 
like image 66
Aarti Avatar answered Sep 03 '25 01:09

Aarti


Unfortunately join_axes function is deprecated in pandas version installed in google colab. If you downgrade pandas library version you can use Pandas Profiling. Just use in your colab:

! pip install pandas==0.25

Then restart the kernel!

However, you will not be able to use

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

as Google Colab does not support ipywidgets yet. But if you just use

profile

you will get a report

like image 21
moli Avatar answered Sep 03 '25 01:09

moli