-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Open
Labels
IO JSONread_json, to_json, json_normalizeread_json, to_json, json_normalizeTimestamppd.Timestamp and associated methodspd.Timestamp and associated methods
Milestone
Description
pd.read_json still returns nanoseconds always:
>>> df = pd.DataFrame({"col": range(5), "dates": pd.date_range("2025", periods=5)})
>>> s = df.to_json(date_format="iso")
>>> pd.read_json(io.StringIO(s), convert_dates=["dates"]).dtypes
col int64
dates datetime64[ns]
dtype: objectSince JSON is a format like CSV that has no type / unit information stored, we should follow the general default of microseconds (or nanoseconds if those are present), like we do for CSV (or HTML, XML, excel, etc)
Metadata
Metadata
Assignees
Labels
IO JSONread_json, to_json, json_normalizeread_json, to_json, json_normalizeTimestamppd.Timestamp and associated methodspd.Timestamp and associated methods