-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TypeError: invalid type promotion #18212
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
Comments
This is related with matplotlib/matplotlib#9577 and pydata/xarray#1661 |
https://github.com/pydata/xarray/pull/1669/files provides a hint to the solution/workaround. First execute: from pandas.tseries import converter
converter.register() and then execute above example and everything works fine in pandas==0.21.0. |
Yep, that's the fix. Hopefully this will eventually all be in matplotlib, but for now explicitly registering the converters is required. |
kdebrab i've been struggling with this for 3 days, too bad i didn't find it sooner. Thanks so much for the answers! Much appreciated 10/10 ^_^ |
Hey, coming across this issue in 1.0.0 Since tseries no longer has a
But I'm still getting invalid type promotion. Using a dataframe with a DateTimeIndex and 2 columns of floats. |
Same here, but with sklearn.preprocessing's StandardScaler(). Everything I can tell seems to point to the datetime, I think i saw @TomAugspurger on another seemingly-related issue, too. I have just dropped the datetime column for the time being but will need it back later so... Related to the converter issue, I have seen someone on another issue relate the converter registration to schrodinger's cat, in that it must be either registered or deregistered, so they suggested manually adding either converter.register() or converter.deregister() or something like that |
I'm not sure where to post this, as it involves pandas, seaborn, matplotlib and numpy.
As it works with pandas 0.20.3, but throws an error in pandas 0.21.0, it seems to be a pandas issue. Below, an easily reproducible example:
Throws following error in pandas 0.21.0:
numpy==1.13.3
seaborn==0.8.1
matplotlib==2.1.0
The above code does work fine in pandas 0.20.3, with same versions of numpy, seaborn and matplotlib.
The text was updated successfully, but these errors were encountered: