Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pandas_profiling.ProfileReport(dataframe) in google colab

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

Returns a type error.

TypeError: concat() got an unexpected keyword argument 'join_axes'
like image 545
Слава Варин Avatar asked Jun 18 '20 12:06

Слава Варин


People also ask

How do I import a DataFrame in Colab?

From Github It is the easiest way to upload a CSV file in Colab. For this go to the dataset in your GitHub repository, and then click on “View Raw”. Copy the link to the raw dataset and pass it as a parameter to the read_csv() in pandas to get the dataframe.


Video Answer


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

like image 134
Amar Shinde Avatar answered Oct 08 '22 12:10

Amar Shinde


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.

like image 45
script_kitty Avatar answered Oct 08 '22 12:10

script_kitty