Pandas-profiling: Issue with plot histogram: Unexpected keyword argument 'title'

Created on 2 Mar 2020  路  5Comments  路  Source: pandas-profiling/pandas-profiling

Bug

Running pandas profiler on a (7407573, 5) dataset. I receive the following error

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\multiprocessing\pool.py", line 121, in worker
result = (True, func(args, *kwds))
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\multiprocessing\pool.py", line 44, in mapstar
return list(map(args))
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\site-packages\pandas_profiling\describe.py", line 282, in multiprocess_func
return x[0], describe_1d(x[1], *
kwargs)
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\site-packages\pandas_profiling\describe.py", line 270, in describe_1d
result = result.append(describe_numeric_1d(data, *kwargs))
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\site-packages\pandas_profiling\describe.py", line 54, in describe_numeric_1d
stats['histogram'] = histogram(series, *
kwargs)
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\site-packages\pandas_profiling\plot.py", line 73, in histogram
plot = _plot_histogram(series, **kwargs)
TypeError: _plot_histogram() got an unexpected keyword argument 'title'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:/Users/maingijo/PycharmProjects/DataReshaper/Test.py", line 20, in
create_pd_profile()
File "C:/Users/maingijo/PycharmProjects/DataReshaper/Test.py", line 13, in create_pd_profile
dataprofile = ProfileReport(tt, title = 'Data Profiling Report', html = {'style': {'full_width': True}})
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\site-packages\pandas_profiling__init__.py", line 66, in __init__
description_set = describe(df, **kwargs)
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\site-packages\pandas_profiling\describe.py", line 351, in describe
ldesc = {col: s for col, s in pool.map(local_multiprocess_func, df.iteritems())}
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\multiprocessing\pool.py", line 290, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "C:\Users\maingijo\AppData\Local\Continuumanaconda3\envs\ds\lib\multiprocessing\pool.py", line 683, in get
raise self._value
TypeError: _plot_histogram() got an unexpected keyword argument 'title'

To Reproduce

_Data:_

RangeIndex: 7407573 entries, 0 to 7407572
Data columns (total 5 columns):
Column Dtype
--- ------ -----
0 a object
1 b object
2 c object
3 d float64
4 e float64
dtypes: float64(2), object(3)
memory usage: 282.6+ MB

Code
`import pandas as pd
import multiprocessing
from pandas_profiling import ProfileReport

def create_pd_profile():
f = '.../filetoread.csv'
tt = pd.read_csv(f, sep = ',', header = [0], thousands = ',', encoding = 'utf-8',
skipinitialspace = True, error_bad_lines = False, warn_bad_lines = True)

print(tt.head())
print("Exporting Data Profile . . .")
dataprofile = ProfileReport(tt, title = 'Data Profiling Report', html = {'style': {'full_width': True}})
dataprofile.to_file(
    outputfile = ".../Data_Profiling_Report.html")

if __name__=="__main__":
multiprocessing.freeze_support()
create_pd_profile()
`
Version information:

  • _Python version_: Python 3.7, pandas 1.0
  • _Environment_: PyCharm installed via conda
bug 馃悰

Most helpful comment

Uninstalling and then reinstalling using _pip_ worked for me

pip uninstall pandas-profiling
pip install pandas-profiling[notebook,html]

All 5 comments

Two possible sources of error:

  • if name=="main": is not the right syntax

  • Pandas 1.0+ is not yet supported

Uninstalling and then reinstalling using _pip_ worked for me

pip uninstall pandas-profiling
pip install pandas-profiling[notebook,html]

@The-Gupta's solution worked for me as well. I used it in a Colab notebook, nice :D!

thank you ,it is working

Python 3.8.5

Blessings upon you!

I used Anaconda to install the pandas_profiling and didn't notice that it was version 1.4.1.
Once I uninstalled it and re-installed it following the suggested PIP in the article, np!

The PIP installs pandas_profiling version 2.9.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

richdevboston picture richdevboston  路  5Comments

AmauryLepicard picture AmauryLepicard  路  5Comments

iolap-mmeyyappan picture iolap-mmeyyappan  路  3Comments

jankaWIS picture jankaWIS  路  3Comments

haripriyatv01 picture haripriyatv01  路  5Comments