File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -939,6 +939,7 @@ Performance improvements
939
939
- Improved performance by removing the need for a garbage collect when checking for `` SettingWithCopyWarning`` (:issue:`27031 ` )
940
940
- For :meth:`to_datetime` changed default value of cache parameter to `` True `` (:issue:`26043 ` )
941
941
- Improved performance of :class :`DatetimeIndex` and :class :`PeriodIndex` slicing given non- unique, monotonic data (:issue:`27136 ` ).
942
+ - Improved performance of :meth:`pd.read_json` for index- oriented data. (:issue:`26773 ` )
942
943
943
944
944
945
.. _whatsnew_0250.bug_fixes:
Original file line number Diff line number Diff line change @@ -1085,9 +1085,15 @@ def _parse_no_numpy(self):
1085
1085
self .check_keys_split (decoded )
1086
1086
self .obj = DataFrame (dtype = None , ** decoded )
1087
1087
elif orient == "index" :
1088
- self .obj = DataFrame (
1089
- loads (json , precise_float = self .precise_float ), dtype = None
1090
- ).T
1088
+ self .obj = (
1089
+ DataFrame .from_dict (
1090
+ loads (json , precise_float = self .precise_float ),
1091
+ dtype = None ,
1092
+ orient = "index" ,
1093
+ )
1094
+ .sort_index (axis = "columns" )
1095
+ .sort_index (axis = "index" )
1096
+ )
1091
1097
elif orient == "table" :
1092
1098
self .obj = parse_table_schema (json , precise_float = self .precise_float )
1093
1099
else :
You can’t perform that action at this time.
0 commit comments