leotac / joypy

Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:
MIT License
559 stars 59 forks source link

pandas.plotting._tools not supported in pandas 0.25.0 #38

Closed simon-m-mudd closed 5 years ago

simon-m-mudd commented 5 years ago

I have not extensively tested this, but it seems the

from pandas.plotting._tools import (_subplots, _flatten)

does not work in the new pandas (0.25.0, released July 18th)

Error is: from pandas.plotting._tools import (_subplots, _flatten) ModuleNotFoundError: No module named 'pandas.plotting._tools'

The code works perfectly fine in pandas 0.24.2

leotac commented 5 years ago

It seems that starting from 0.25, pandas had moves those internal functions into pandas.plotting._matplotlib.tools. You are welcome to open a PR with a fix - a quick one could be to use a try/except block around the current import and try the new one if the first one fails.

The real longer-term solution would be to stop relying on those 2 internal functions that are not guaranteed to be broken by newer releases of pandas.

leotac commented 5 years ago

Fixed by #39