We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18a3eec commit 9805875Copy full SHA for 9805875
pandas/io/json/_json.py
@@ -1167,6 +1167,7 @@ def _try_convert_data(
1167
"""
1168
Try to parse a Series into a column by inferring dtype.
1169
1170
+ backup_data = data
1171
# don't try to coerce, unless a force conversion
1172
if use_dtypes:
1173
if not self.dtype:
@@ -1221,7 +1222,7 @@ def _try_convert_data(
1221
1222
if len(data) and data.dtype in ("float", "object"):
1223
# coerce ints if we can
1224
try:
- new_data = data.astype("int64")
1225
+ new_data = backup_data.astype("int64")
1226
if (new_data == data).all():
1227
data = new_data
1228
converted = True
0 commit comments