BUG: MultiIndex.dtypes index behavior changes after 1.4.x · Issue #46900 · pandas-dev/pandas (original) (raw)

Pandas version checks

Reproducible Example

After 1.4.x:

arrays​ ​=​ [[​1​, ​1​, ​2​, ​2​], [​"red"​, ​"blue"​, ​"red"​, ​"blue"​]] pmidx = pd.MultiIndex.from_arrays(arrays, names=[("zero", "first"), ("one", "second")])

pmidx.dtypes.index Index([('zero', 'first'), ('one', 'second')], dtype='object')

Issue Description

dtypes index behavior changes.

Expected Behavior

pmidx = pd.MultiIndex.from_arrays(arrays, names=[("zero", "first"), ("one", "second")])
>>> pmidx.dtypes.index
MultiIndex([('zero',  'first'),
            ( 'one', 'second')],
           )

Installed Versions

pandas 1.4.2