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.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serializing a data frame with an interval index to JSON and then deserializing it fails to recover the index. Here is an example:
df = pd.DataFrame(index=pd.IntervalIndex(closed='left', dtype='interval[int64]', data=[pd.Interval(0, 2, closed='left')]), data={'a': [42'}) serialized = df.to_json(orient='table') deserialized = pd.read_json(serialized, orient='table')
Looking at serialized reveals that the interval index is serialized as any type looking like that:
serialized
any
{"closed":"left","closed_right":false,"left":0,"mid":0.5,"open_right":true,"right":1}
and looking at deserialized.index[0] reveals that the interval type wasn't recovered but rather the de-serialized value is still a dict:
deserialized.index[0]
{'closed': 'left', 'closed_right': False, 'left': 0, 'mid': 1.0, 'open_right': True, 'right': 2}
The text was updated successfully, but these errors were encountered:
to_json()
read_json()
@konstantinmiller Thanks for the report. I can confirm that the issue exists on master.
Sorry, something went wrong.
xref #32037
orient="table"
No branches or pull requests
Serializing a data frame with an interval index to JSON and then deserializing it fails to recover the index. Here is an example:
Looking at
serialized
reveals that the interval index is serialized asany
type looking like that:and looking at
deserialized.index[0]
reveals that the interval type wasn't recovered but rather the de-serialized value is still a dict:The text was updated successfully, but these errors were encountered: