File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -980,6 +980,7 @@ Performance improvements
980
980
- Improved performance by removing the need for a garbage collect when checking for `` SettingWithCopyWarning`` (:issue:`27031 ` )
981
981
- For :meth:`to_datetime` changed default value of cache parameter to `` True `` (:issue:`26043 ` )
982
982
- Improved performance of :class :`DatetimeIndex` and :class :`PeriodIndex` slicing given non- unique, monotonic data (:issue:`27136 ` ).
983
+ - Improved performance of :meth:`pd.read_json` for index- oriented data. (:issue:`26773 ` )
983
984
984
985
.. _whatsnew_0250.bug_fixes:
985
986
Original file line number Diff line number Diff line change @@ -1092,9 +1092,15 @@ def _parse_no_numpy(self):
1092
1092
self .check_keys_split (decoded )
1093
1093
self .obj = DataFrame (dtype = None , ** decoded )
1094
1094
elif orient == "index" :
1095
- self .obj = DataFrame (
1096
- loads (json , precise_float = self .precise_float ), dtype = None
1097
- ).T
1095
+ self .obj = (
1096
+ DataFrame .from_dict (
1097
+ loads (json , precise_float = self .precise_float ),
1098
+ dtype = None ,
1099
+ orient = "index" ,
1100
+ )
1101
+ .sort_index (axis = "columns" )
1102
+ .sort_index (axis = "index" )
1103
+ )
1098
1104
elif orient == "table" :
1099
1105
self .obj = parse_table_schema (json , precise_float = self .precise_float )
1100
1106
else :
You can’t perform that action at this time.
0 commit comments