Skip to content

BUG: MultiIndex.dtypes index behavior changes after 1.4.x #46900

Closed
@Yikun

Description

@Yikun

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsMultiIndexRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions