Skip to content

Commit

Permalink
Merge pull request #2399 from mattijn/pandas-nullable-float-data
Browse files Browse the repository at this point in the history
support serializing nullable float data
  • Loading branch information
jakevdp authored Nov 12, 2021
2 parents ea35b61 + 26a00b4 commit 03be44a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion altair/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ def to_list_if_array(val):
"UInt16",
"UInt32",
"UInt64",
}: # nullable integer datatypes (since 24.0)
"Float32",
"Float64",
}: # nullable integer datatypes (since 24.0) and nullable float datatypes (since 1.2.0)
# https://pandas.pydata.org/pandas-docs/version/0.25/whatsnew/v0.24.0.html#optional-integer-na-support
col = df[col_name].astype(object)
df[col_name] = col.where(col.notnull(), None)
Expand Down

0 comments on commit 03be44a

Please sign in to comment.