Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: _plot_histogram() got an unexpected keyword argument 'title' #528

Closed
kseniiailchenko opened this issue Jul 27, 2020 · 10 comments
Closed

Comments

@kseniiailchenko
Copy link

Hello, I am trying to use pandas_profiling but I got an isssue with _plot histogram() it seems.
I have pandas version 1.0.5 and pandas_profiling 2.7.1
Please see the code and error description below.

import pandas as pd
import pandas_profiling as pp

from pandas_profiling import ProfileReport
df = pd.DataFrame(
np.random.rand(100, 5),
columns=["a", "b", "c", "d", "e"]
)
profile = ProfileReport(df, title="Pandas Profiling Report")
RemoteTraceback:
"""
Traceback (most recent call last):
File "Z:\Documents\anaconda\lib\multiprocessing\pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "Z:\Documents\anaconda\lib\multiprocessing\pool.py", line 44, in mapstar
return list(map(*args))
File "C:\Users\ILCHENKO\pandas_profiling\describe.py", line 282, in multiprocess_func
return x[0], describe_1d(x[1], **kwargs)
File "C:\Users\ILCHENKO\pandas_profiling\describe.py", line 270, in describe_1d
result = result.append(describe_numeric_1d(data, **kwargs))
File "C:\Users\ILCHENKO\pandas_profiling\describe.py", line 54, in describe_numeric_1d
stats['histogram'] = histogram(series, **kwargs)
File "C:\Users\ILCHENKO\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 "", line 12, in
profile = ProfileReport(df, title="Pandas Profiling Report")

File "C:\Users\ILCHENKO\pandas_profiling_init_.py", line 66, in init
description_set = describe(df, **kwargs)

File "C:\Users\ILCHENKO\pandas_profiling\describe.py", line 351, in describe
ldesc = {col: s for col, s in pool.map(local_multiprocess_func, df.iteritems())}

File "Z:\Documents\anaconda\lib\multiprocessing\pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()

File "Z:\Documents\anaconda\lib\multiprocessing\pool.py", line 657, in get
raise self._value

TypeError: _plot_histogram() got an unexpected keyword argument 'title'

Could you please advise me something?
Thank you

@sbrugman
Copy link
Collaborator

sbrugman commented Aug 2, 2020

Does this issue persist when updating to the lastest version?

@ktbuzek
Copy link

ktbuzek commented Aug 2, 2020

Update again

uninstalling and using the most recent anaconda version fixed my problem.. I know not everyone has that option.. but I suspect this has something to do with Pillow and kwargs being depreciated in pandas 1.0+ (not exact version)

update - I have found that pillow is outdated, a dependency for matplotlib. I am trying to get a newer version of anaconda so I can update it past 5.4, it requires 6.2. My current version of conda is 4.8.3

I have the same problem, I just installed it today - I also tried updating matplot lib to no avail.

I tested in command prompt and got the same error about _plot_histogram() got an unexpected keyword argument 'title'.

I tried running without the argument, and got this:


TypeError Traceback (most recent call last)
in
3 normalized_numeric=(numeric-numeric.mean())/numeric.std()
4
----> 5 numeric_profile = ProfileReport(normalized_numeric)

~\Anaconda3\lib\site-packages\pandas_profiling_init_.py in init(self, df, **kwargs)
64 sample = kwargs.get('sample', df.head())
65
---> 66 description_set = describe_df(df, **kwargs)
67
68 self.html = to_html(sample,

~\Anaconda3\lib\site-packages\pandas_profiling\describe.py in describe(df, bins, check_correlation, correlation_threshold, correlation_overrides, check_recoded, pool_size, **kwargs)
402 if name not in names:
403 names.append(name)
--> 404 variable_stats = pd.concat(ldesc, join_axes=pd.Index([names]), axis=1)
405 variable_stats.columns.names = df.columns.names
406

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

@kfeaginsiii
Copy link

I was encountering the 'join_axes' error as well (originally had the title error, uninstall, reinstall got me the the join_axes). It looks like the argument was depreciated in Pandas 1.0.0. pandas-dev/pandas#22318. Upon further investigation, the reinstall from conda picked up Pandas-Profiling 1.4.1.
conda install pandas-profiling==2.8.0
seems to get things corrected. It sounds like a non-specified version install via conda, depending on environment, can result in a minimum version, opposed to latest version? No other packages needed update to support the 2.8.0 on my env. Odd.

In a separate issue, .to_widgets() results in an AttributeError: 'Tab' object has no attribute 'set_title'
I instead was able to display in Jupyter using .to_notebook_iframe()

@sbrugman
Copy link
Collaborator

@kfeaginsiii Odd indeed. We have seen this before when pip and conda packages are mixed in the same environment.

@nateGeorge
Copy link

For me, this was just an older version of pandas-profiling I needed to upgrade.

@nickcorona
Copy link

nickcorona commented Jan 18, 2021

No, this happens in the latest version as well.

@robroc
Copy link

robroc commented Jan 19, 2021

I got the same error when installing from conda-forge, which is version 1.4.1. Specifying the version like @kfeaginsiii suggested worked.

@vasili111
Copy link

Same problem problem is with installing from conda forge which is the version 1.4.1. No problem after installing with pip.

@jruots
Copy link

jruots commented Mar 9, 2021

pip install pandas-profiling==2.8.0 fixed it for me. Originally installed from conda forge and it came in as version 1.4.1.

@ahprh12
Copy link

ahprh12 commented May 4, 2021

Update as of 5/4/2021, the above command mentioned by @jruots, "pip install pandas-profiling==2.8.0" solves this issue. the basic example in the readme is up and running in my notebook. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants