Skip to content

CLN: remove odious kludge #31907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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