-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIO JSONread_json, to_json, json_normalizeread_json, to_json, json_normalize
Milestone
Description
>>> df = pd.DataFrame(range(3), index=list("123"))
>>> df.to_json(orient="split")
'{"columns":[0],"index":["1","2","3"],"data":[[0],[1],[2]]}'
>>> pd.read_json(df.to_json(orient="split"), orient="split").index
Int64Index([1, 2, 3], dtype='int64')
Note that the string nature of the values should be preserved via roundtrip here, but ends up being lossy anyway. Noted during refactor of #28510
Metadata
Metadata
Assignees
Labels
BugDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsIO JSONread_json, to_json, json_normalizeread_json, to_json, json_normalize