Skip to content

DEPR: Deprecate numpy argument in read_json #28512

Closed
@WillAyd

Description

@WillAyd

I've never really been clear on the purpose of the numpy argument in to_json. Some digging brought me here #3876 (comment) where it is explained that this maintains some kind of sequence to elements. To illustrate the only difference I could find

>>> pd.read_json('[{"a": 1, "b": 2}, {"b":2, "a" :1}]',numpy=False, orient='records')
   a  b
0  1  2
1  1  2

>>> pd.read_json('[{"a": 1, "b": 2}, {"b":2, "a" :1}]',numpy=True, orient='records')
   a  b
0  1  2
1  2  1

I might be missing the point but I don't understand why this would be useful. Objects in JSON are by definition not ordered, so this is non-compliant and I think just plain confusing.

So I think good to deprecate unless anyone has objections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandasIO JSONread_json, to_json, json_normalizegood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions