Skip to content

BUG: Weird column name type conversion in read_json with orient='table' and string columns #25435

Closed
@albertvillanova

Description

@albertvillanova

Code Sample, a copy-pastable example if possible

expected = pd.DataFrame({'1.': [1, 2]})
result = pd.read_json(expected.to_json(orient='table'), orient='table')
In [7]: expected                                                                                                                               
Out[7]: 
   1.
0   1
1   2

In [8]: result                                                                                                                                 
Out[8]: 
   1970-01-01 00:00:01
0                    1
1                    2

Problem description

There is a weird column type conversion from string to Timestamp.

Expected Output

The result should be equal to expected.

Output of pd.show_versions()

AttributeError: module 'tables' has no attribute 'version'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsIO JSONread_json, to_json, json_normalize

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions