-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Cannot represent empty MultiIndex #263
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
Comments
Hm, that's a bit ill-defined, isn't it (having no levels vs. length 0 levels which is what
Could you show how it leads to problems in set operations? |
The only problem with set operations is with the patch which I submitted adding |
I got it. I'll take a look later today or early tomorrow and sort out a resolution, there may indeed be an upstream problem. |
I think this is resolved in my commit earlier tonight. So this works fine now:
|
Not quite. I think the MultiIndex constructor should permit construction of an empty MultiIndex. Try this:
The different sort order means it fails the equality trap in Sidenote 1: Are the repr outputs of MultiIndex supposed to be round-trippable? Python docs suggest that this should be the case for Sidenote 2: |
You're right, I was being lazy, this is the way to create an empty index (also only passing on the level names if they're the same...will write a test for this):
here's the commit Sidenote 1: round-trippable |
There's a separate bug in the function which is that you should not pass an empty list to |
Mongo quota improvements
An empty MultiIndex cannot be constructed:
This does not maintain parity with regular indices, where an empty index may be constructed:
And causes problems when doing set operations with MultiIndexes.
The text was updated successfully, but these errors were encountered: