File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ Performance improvements
285
285
- Performance improvement accessing :attr: `arrays.IntegerArrays.dtype ` & :attr: `arrays.FloatingArray.dtype ` (:issue: `52998 `)
286
286
- Performance improvement in :class: `Series ` reductions (:issue: `52341 `)
287
287
- Performance improvement in :func: `concat ` when ``axis=1 `` and objects have different indexes (:issue: `52541 `)
288
+ - Performance improvement in :meth: `DataFrame.loc ` when selecting rows and columns (:issue: `53014 `)
288
289
- Performance improvement in :meth: `Series.corr ` and :meth: `Series.cov ` for extension dtypes (:issue: `52502 `)
289
290
- Performance improvement in :meth: `Series.to_numpy ` when dtype is a numpy float dtype and ``na_value `` is ``np.nan `` (:issue: `52430 `)
290
291
- Performance improvement in :meth: `~arrays.ArrowExtensionArray.to_numpy ` (:issue: `52525 `)
Original file line number Diff line number Diff line change @@ -933,7 +933,9 @@ def _getitem_tuple_same_dim(self, tup: tuple):
933
933
This is only called after a failed call to _getitem_lowerdim.
934
934
"""
935
935
retval = self .obj
936
- for i , key in enumerate (tup ):
936
+ # Selecting columns before rows is signficiantly faster
937
+ for i , key in enumerate (reversed (tup )):
938
+ i = self .ndim - i - 1
937
939
if com .is_null_slice (key ):
938
940
continue
939
941
You can’t perform that action at this time.
0 commit comments