Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
Yikun opened this issue Apr 30, 2022 · 4 comments · Fixed by #47349
Closed
3 tasks done

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

Yikun opened this issue Apr 30, 2022 · 4 comments · Fixed by #47349
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions MultiIndex Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@Yikun
Copy link
Contributor

Yikun commented Apr 30, 2022

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

@Yikun Yikun added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 30, 2022
@Yikun
Copy link
Contributor Author

Yikun commented Apr 30, 2022

d06fb91

cc @johnzangwill

@rhshadrach
Copy link
Member

Thanks for the report - can you add the values of arrays to your example in the OP.

@rhshadrach rhshadrach added Dtype Conversions Unexpected or buggy dtype conversions MultiIndex Needs Info Clarification about behavior needed to assess issue labels Apr 30, 2022
@Yikun
Copy link
Contributor Author

Yikun commented May 1, 2022

@rhshadrach Sorry before, added.

@simonjayhawkins
Copy link
Member

d06fb91

xref #45175

@simonjayhawkins simonjayhawkins added Regression Functionality that used to work in a prior pandas version and removed Needs Info Clarification about behavior needed to assess issue Needs Triage Issue that has not been reviewed by a pandas team member labels May 4, 2022
@simonjayhawkins simonjayhawkins added this to the 1.4.3 milestone May 4, 2022
simonjayhawkins added a commit to simonjayhawkins/pandas that referenced this issue May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions MultiIndex Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants