Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pandas/io/json/_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@ def _try_convert_data(
"""
Try to parse a Series into a column by inferring dtype.
"""
backup_data = data
# don't try to coerce, unless a force conversion
if use_dtypes:
if not self.dtype:
Expand Down Expand Up @@ -1221,7 +1222,7 @@ def _try_convert_data(
if len(data) and data.dtype in ("float", "object"):
# coerce ints if we can
try:
new_data = data.astype("int64")
new_data = backup_data.astype("int64")
if (new_data == data).all():
data = new_data
converted = True
Expand Down