Skip to content

Validate that MultiIndex labels are Int64 type when not called internally. #5212

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
jtratner opened this issue Oct 14, 2013 · 2 comments
Closed
Assignees
Labels
Enhancement Error Reporting Incorrect or improved errors from pandas Internals Related to non-user accessible pandas implementation MultiIndex

Comments

@jtratner
Copy link
Contributor

Right now you could create MI with weird types and it doesn't error out. More difficult to do effectively when MI is an ndarray subclass (because there are so many different ways to instantiate a MultiIndex). Will fix in Index refactor (just want to remember to do so).

@ghost ghost assigned jtratner Oct 14, 2013
@jreback jreback modified the milestones: 0.15.0, 0.14.0 Mar 28, 2014
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 3, 2015
@toobaz
Copy link
Member

toobaz commented May 18, 2018

@jtratner does #19074 change anything?

@mroeschke mroeschke added Enhancement Error Reporting Incorrect or improved errors from pandas labels Apr 27, 2020
@mroeschke
Copy link
Member

It appears that codes are dtyped resized internally

In [69]: pd.MultiIndex(levels=mi.levels, codes=np.array([[0., 0., 1., 1.], [1., 0., 1., 0.]], dtype=np.in
    ...: t32)).codes[0]
Out[69]: array([0, 0, 1, 1], dtype=int8)

So this is probably not an issue anymore. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Error Reporting Incorrect or improved errors from pandas Internals Related to non-user accessible pandas implementation MultiIndex
Projects
None yet
Development

No branches or pull requests

4 participants