Skip to content

Commit cde96f8

Browse files
summonholmessummonholmes
summonholmes
authored and
summonholmes
committed
Isolate the exact array shape when issue occurs
1 parent da274d9 commit cde96f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5282,7 +5282,7 @@ 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.size > 2:
5285+
elif converted.shape == (1, 2, 2):
52865286
# When nested tuples are incorrectly converted
52875287
# to > 2 dimensions (Extremely rare)
52885288
index_like = np.ndarray((1, 2), dtype=tuple)

0 commit comments

Comments
 (0)