BUG: DataFrame#to_json
in pandas 2.2.0 outputs Int64
values containing NA
as floats
#57224
Closed
2 of 3 tasks
Labels
IO JSON
read_json, to_json, json_normalize
Regression
Functionality that used to work in a prior pandas version
Milestone
Pandas version checks
Reproducible Example
Issue Description
In pandas 2.1.4,
DataFrame#to_json
outputsInt64
integers as JSON integers even if the column containsNA
, as shown below. This is an expected behavior.However, in pandas 2.2.0,
DataFrame#to_json
outputsInt64
integers as JSON floats for columns containingNA
, as shown below.Note that even in 2.2.0,
Int64
column values that do not contain anyNA
are output as JSON integers as expected.This problem also occurs in
Series
as follows.Expected Behavior
As in pandas 2.1.4,
Int64
column values should be output as JSON integers even if they containNA
.Installed Versions
The text was updated successfully, but these errors were encountered: