Skip to content

BUG: MultiIndex.from_arrays doesn't raise if arrays are unequal lengths #10127

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
TomAugspurger opened this issue May 13, 2015 · 2 comments
Closed

Comments

@TomAugspurger
Copy link
Contributor

In [62]: index = pd.MultiIndex.from_arrays([['a', 'b', 'c'], [1, 2]])

In [63]: index
Out[63]:
MultiIndex(levels=[['a', 'b', 'c'], [1, 2]],
           labels=[[0, 1, 2], [0, 1]])

Probably not what the user wants, and we rely on them being the same length in, e.g. index.shape which will raise a ValueError if you access it.

@TomAugspurger TomAugspurger changed the title BUG: MultiIndex.from_array doesn't raise if arrays are unequal lengths BUG: MultiIndex.from_arrays doesn't raise if arrays are unequal lengths May 13, 2015
@TomAugspurger TomAugspurger added this to the 0.17.0 milestone May 13, 2015
@jreback jreback added the Bug label May 13, 2015
@jreback jreback modified the milestones: Next Major Release, 0.17.0 Aug 15, 2015
@mroeschke
Copy link
Member

This looks like a duplicate of #13599 which is closed by #13728.

@TomAugspurger
Copy link
Contributor Author

Indeed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants