BUG: PeriodIndex does not survive JSON serialization roundtrip #44720
Labels
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
IO JSON
read_json, to_json, json_normalize
Period
Period data type
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the master branch of pandas.
Reproducible Example
Issue Description
The index should make the roundtrip.
Possible related issue: #32665
Expected Behavior
From my point of view, this issue has two parts, the title and example report on the overall issue which is the failure to roundtrip the index when using JSON to serialize the DataFrame.
The second part of the issue is that when reading from JSON, the index gets serialized to a
DatetimeIndex
withfreq=None
.In the JSON however, the frequency is there, see the output of
df.to_json(orient='table')
for the previous example:Notice how the
index
field has thefreq
correctly set.Installed Versions
The text was updated successfully, but these errors were encountered: