Skip to content

Commit

Permalink
edge case for ndarray only
Browse files Browse the repository at this point in the history
  • Loading branch information
summonholmes authored and summonholmes committed Jan 12, 2019
1 parent 5143c18 commit ef91ba2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5282,7 +5282,8 @@ 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.shape == (1, 2, 2):
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)
Expand Down

0 comments on commit ef91ba2

Please sign in to comment.