diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index 44b3c318366d2..f498e1696ea5b 100755 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -755,18 +755,11 @@ def _getitem_lowerdim(self, tup: Tuple): new_key = tup[:i] + (_NS,) + tup[i + 1 :] else: + # Note: the section.ndim == self.ndim check above + # rules out having DataFrame here, so we dont need to worry + # about transposing. new_key = tup[:i] + tup[i + 1 :] - # unfortunately need an odious kludge here because of - # DataFrame transposing convention - if ( - isinstance(section, ABCDataFrame) - and i > 0 - and len(new_key) == 2 - ): - a, b = new_key - new_key = b, a - if len(new_key) == 1: new_key = new_key[0]