8000 BUG: Prevent 3D-ndarray for nested tuple labels (#24687) by summonholmes · Pull Request #24732 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Prevent 3D-ndarray for nested tuple labels (#24687) #24732

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

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Revert fork to original state
  • Loading branch information
shanekimble committed Jan 14, 2019
commit cec3d574f3f63b9a8539648df7f219c4f355e3c8
7 changes: 0 additions & 7 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5282,13 +5282,6 @@ def ensure_index(index_like, copy=False):
if len(converted) > 0 and all_arrays:
from .multi import MultiIndex
return MultiIndex.from_arrays(converted)
elif isinstance(converted, np.ndarray) and converted.shape == (1, 2,
2):
# When nested tuples are incorrectly converted
# to > 2 dimensions (Extremely rare)
index_like = np.ndarray((1, 2), dtype=tuple)
index_like[0][0] = tuple(converted[0][0])
index_like[0][1] = tuple(converted[0][1])
else:
index_like = converted
else:
Expand Down
0