pandas_profiling.ProfileReport(dataframe) in google colab

Viewed 4051

Why doesn't pandas_profiling.ProfileReport(dataframe) work in google colab?

Returns a type error.

TypeError: concat() got an unexpected keyword argument 'join_axes'
2 Answers

Just use pandas-profiling version 2.7.1 and you are good to go.Run this command in the colab !pip install pandas-profiling==2.7.1

Aishah Ismail's post on Medium may help you fix this issue.

Install the pandas-profiling package using pip. ! pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip

Restart your kernel = Go to "Runtime" in the option menu and click "Reset All Runtimes"

Execute your code to create your dataframe and create the pandas profile.

import pandas as pd
import numpy as np
from pandas_profiling import ProfileReport
 
df = pd.read_excel('fileName.xlsx')
profile = ProfileReport(df)
profile.to_notebook_iframe()

You may need to pip install pandas-profiling if the import above does not work. !pip install pandas-profiling==2.7.1 Re-execute your code after the pip install.

When you try to display the profile do not use .to_widgets()--it isn't working in Colab.

If the above doesn't work, I suggest switching to Jupyter Lab or Jupyter Notebook. The pandas profile dashboard works well in the Jupyter environment.

I hope this helps! Pandas-Profiling a wonderful EDA tool--such a time saver.

Related