Skip to content

Commit ef91ba2

Browse files
summonholmessummonholmes
summonholmes
authored and
summonholmes
committed
edge case for ndarray only
1 parent 5143c18 commit ef91ba2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/indexes/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5282,7 +5282,8 @@ def ensure_index(index_like, copy=False):
52825282
if len(converted) > 0 and all_arrays:
52835283
from .multi import MultiIndex
52845284
return MultiIndex.from_arrays(converted)
5285-
elif converted.shape == (1, 2, 2):
5285+
elif isinstance(converted, np.ndarray) and converted.shape == (1, 2,
5286+
2):
52865287
# When nested tuples are incorrectly converted
52875288
# to > 2 dimensions (Extremely rare)
52885289
index_like = np.ndarray((1, 2), dtype=tuple)

0 commit comments

Comments
 (0)