Skip to content

Commit 9805875

Browse files
authored
1 parent 18a3eec commit 9805875

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/io/json/_json.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,7 @@ def _try_convert_data(
11671167
"""
11681168
Try to parse a Series into a column by inferring dtype.
11691169
"""
1170+
backup_data = data
11701171
# don't try to coerce, unless a force conversion
11711172
if use_dtypes:
11721173
if not self.dtype:
@@ -1221,7 +1222,7 @@ def _try_convert_data(
12211222
if len(data) and data.dtype in ("float", "object"):
12221223
# coerce ints if we can
12231224
try:
1224-
new_data = data.astype("int64")
1225+
new_data = backup_data.astype("int64")
12251226
if (new_data == data).all():
12261227
data = new_data
12271228
converted = True

0 commit comments

Comments
 (0)