Skip to content

Commit 6dfd976

Browse files
author
Pyry Kovanen
committed
BUG: Fix empty Data frames to JSON round-trippable back to data frames (pandas-dev#21287)
1 parent cbec58e commit 6dfd976

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/io/json/table_schema.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def parse_table_schema(json, precise_float):
296296
"""
297297
table = loads(json, precise_float=precise_float)
298298
col_order = [field['name'] for field in table['schema']['fields']]
299-
df = DataFrame(table['data'])[col_order]
299+
df = DataFrame(table['data'], columns=col_order)[col_order]
300300

301301
dtypes = {field['name']: convert_json_field_to_pandas_type(field)
302302
for field in table['schema']['fields']}

0 commit comments

Comments
 (0)