We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5143c18 commit ef91ba2Copy full SHA for ef91ba2
pandas/core/indexes/base.py
@@ -5282,7 +5282,8 @@ def ensure_index(index_like, copy=False):
5282
if len(converted) > 0 and all_arrays:
5283
from .multi import MultiIndex
5284
return MultiIndex.from_arrays(converted)
5285
- elif converted.shape == (1, 2, 2):
+ elif isinstance(converted, np.ndarray) and converted.shape == (1, 2,
5286
+ 2):
5287
# When nested tuples are incorrectly converted
5288
# to > 2 dimensions (Extremely rare)
5289
index_like = np.ndarray((1, 2), dtype=tuple)
0 commit comments