10000 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
Next Next commit
Isolate the exact array shape when issue occurs
  • Loading branch information
summonholmes authored and summonholmes committed Jan 12, 2019
commit cde96f8db91f23e213c5abae8db2c3bc7be2da7c
2 changes: 1 addition & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5282,7 +5282,7 @@ def ensure_index(index_like, copy=False):
if len(converted) > 0 and all_arrays:
from .multi import MultiIndex
return MultiIndex.from_arrays(converted)
elif converted.size > 2:
elif converted.shape == (1, 2, 2):
# When nested tuples are incorrectly converted
# to > 2 dimensions (Extremely rare)
index_like = np.ndarray((1, 2), dtype=tuple)
Expand Down
0