-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
API/ERR/ENH: Allow MultiIndex.from_tuples to handle NaNs #23578
Comments
cc @toobaz |
I guess there should be a link between the two following proposals I see in this issue, but I'm failing to grasp it.
What do you mean by "an array"? Creating a
In any case, I fail to see the link with point 1). |
This failing example seem to work now. Could use a test |
Hi @mroeschke I went through the issue and related discussions and I found commit , mentioned here It contains the same taste case that I think we want to add. I would like to contribute, could you please guide me on how should I proceed next? Thank you! |
This is the origin of #23558 and #23677, but IMO worthy to fix in its own right:
Trying to create a MultiIndex from a list of tuples containing NaNs (like
Index.str.partition
does if there are NaNs present) yields:However, it works easily when passing a tuple of NaNs
In fact, the length of the tuple is irrelevant:
Aside from the inconvenience, it is also a real problem to set elements of an array (say if there are several NaNs) to tuples, because they almost always get interpreted as another axis/list-like and then give creative errors.
I'm thinking this extra fail-safe should not be controversial, and I've got a fix prepared already, which is blocked by #23582 (at least in terms of adding tests).
The text was updated successfully, but these errors were encountered: