Skip to content

Commit 634a41f

Browse files
authored
CLN: remove odious kludge (pandas-dev#31907)
1 parent 415e43b commit 634a41f

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

pandas/core/indexing.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -755,18 +755,11 @@ def _getitem_lowerdim(self, tup: Tuple):
755755
new_key = tup[:i] + (_NS,) + tup[i + 1 :]
756756

757757
else:
758+
# Note: the section.ndim == self.ndim check above
759+
# rules out having DataFrame here, so we dont need to worry
760+
# about transposing.
758761
new_key = tup[:i] + tup[i + 1 :]
759762

760-
# unfortunately need an odious kludge here because of
761-
# DataFrame transposing convention
762-
if (
763-
isinstance(section, ABCDataFrame)
764-
and i > 0
765-
and len(new_key) == 2
766-
):
767-
a, b = new_key
768-
new_key = b, a
769-
770763
if len(new_key) == 1:
771764
new_key = new_key[0]
772765

0 commit comments

Comments
 (0)