Skip to content

Commit

Permalink
CLN: remove odious kludge (pandas-dev#31907)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored Feb 12, 2020
1 parent 415e43b commit 634a41f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 634a41f

Please sign in to comment.