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

support serializing nullable float data #2399

Merged
merged 2 commits into from
Nov 12, 2021
Merged

support serializing nullable float data #2399

merged 2 commits into from
Nov 12, 2021

Conversation

mattijn
Copy link
Contributor

@mattijn mattijn commented Feb 4, 2021

Fixes #2398.
This PR introduces support for serialising pandas nullable data types for float data (Float32Dtype and Float64Dtype) that were introduced in pandas 1.2.0.

import pandas as pd
import altair as alt

df = pd.DataFrame({'x': [1, 2, 3, 4, 5, 6, 7], 'y': [10, 30, None, 15, None, 40, 20]}, 
                  dtype=pd.Float32Dtype()) # pd.Float64Dtype()

alt.Chart(df).mark_line(point=True).encode(x='x', y='y')

image

@jakevdp
Copy link
Collaborator

jakevdp commented Feb 8, 2021

Thanks - this looks fine. Once the black formatting check passes, we can get this merged.

@jakevdp
Copy link
Collaborator

jakevdp commented Feb 12, 2021

Looks great, thanks!

@jakevdp jakevdp merged commit 03be44a into vega:master Nov 12, 2021
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

Successfully merging this pull request may close these issues.

Pandas dtype: Float64 is not supported
2 participants