From b11527c94af62ee24132281a79b36cd53bc954eb Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Tue, 11 Feb 2020 17:56:48 -0800 Subject: [PATCH] CLN: remove odious kludge --- pandas/core/indexing.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) 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]