Skip to content

Json import sorting #4703

Closed
Closed
@ghego

Description

@ghego

Noticed that if export a df to json file and then reload the data, ordering is not kept.

import pandas as pd

df.to_json('test.json')
newdf = pd.read_json('test.json')

print df.index

gives:

1
10
100
....

instead of

1
2
3
....

it suffices to call newdf = pd.read_json('test.json').sort() to have the what I'd expect.

Is this intended behaviour or bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsIO JSONread_json, to_json, json_normalize

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions