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

Pandas dtype: Float64 is not supported #2398

Closed
tzipperle opened this issue Feb 3, 2021 · 2 comments · Fixed by #2399
Closed

Pandas dtype: Float64 is not supported #2398

tzipperle opened this issue Feb 3, 2021 · 2 comments · Fixed by #2399
Labels

Comments

@tzipperle
Copy link

Hi,

I have installed: python 3.8.6, pandas 1.2.1 and altair 4.1.0. In the pandas version 1.2.0 they introduced a new "experimental" data type for nullable floats. I know that this type is experimental but a proper handling for nullable data is really convenient.

When I use this new type with altair I get a type error:

df = pd.DataFrame({'a': [1, 2, 3, 4, 5], 'b': [1.1, 2.5, np.nan, 1, 3.3]})
df = df.convert_dtypes()  # convert b from float64 to Float64
chart = alt.Chart(df).mark_line().encode(
    x='a',
    y='b'
)

TypeError: Cannot interpret 'Float64Dtype()' as a data type

@jakevdp
Copy link
Collaborator

jakevdp commented Feb 3, 2021

Thanks - it looks like this arises from the fact that np.issubdtype does not understand pandas new dtypes, which is unfortunate. I suspect that breaks a lot of people's code.

@jakevdp jakevdp added the bug label Feb 3, 2021
@jakevdp
Copy link
Collaborator

jakevdp commented Feb 3, 2021

Indeed, it seems to have broken dask as well: dask/dask#7156

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

Successfully merging a pull request may close this issue.

2 participants