-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Closed
Copy link
Labels
IO JSONread_json, to_json, json_normalizeread_json, to_json, json_normalizeMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNeeds TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsgood first issue
Description
Another edge case brought up by #28510 . I'm not sure if we have a definite stance on this and there are probably a few other issues that are similar, though couldn't find anything exactly matching this
Note the index types for an empty data frame
>>> df = pd.DataFrame()
>>> df.index
Index([], dtype='object')
>>> df.columns
Index([], dtype='object')
In read_json
with convert_axes
the axes labels end up with a different dtype
>>> for orient in ["columns", "index", "records", "values", "split"]:
... print(pd.read_json("{}", orient=orient, convert_axes=True).columns)
...
Float64Index([], dtype='float64')
Float64Index([], dtype='float64')
Float64Index([], dtype='float64')
Float64Index([], dtype='float64')
Float64Index([], dtype='float64')
Metadata
Metadata
Assignees
Labels
IO JSONread_json, to_json, json_normalizeread_json, to_json, json_normalizeMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNeeds TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsgood first issue