Skip to content

BUG: MultiIndex truncated for some non-list arguments #14806

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
wants to merge 3 commits into from

Conversation

groutr
Copy link
Contributor

@groutr groutr commented Dec 6, 2016

closes #14794.

WIP. Discussion/suggestions welcome.

@groutr groutr changed the title BUG: Multi index tuples BUG: MultiIndex truncated for some non-list arguments Dec 6, 2016
string_and_binary_types = string_types + (binary_type,)


class ABC(object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert all this. way out of scope for this issue.

@@ -10,7 +10,7 @@
import pandas.index as _index
from pandas.lib import Timestamp

from pandas.compat import range, zip, lrange, lzip, map
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just import directly from itertools

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zip_longest changed names between Python 2/3 (it was izip_longest in Python 2)

MultiIndex.from_product : Make a MultiIndex from cartesian product
of iterables
"""
try:
arrays = list(arrays)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

else:
arrays = lzip(*tuples)

arrays = zip_longest(*tuples)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert all except for this change here

@jreback
Copy link
Contributor

jreback commented Dec 6, 2016

pls add tests first. just make the simple change and get it to work. then you can do follows to restructure if necessary / more clear. There are a lot of things going going on here (IOW lots of routines hit this), and lots of variations of accepted, so need to be quite careful (and more so about performance).

@groutr
Copy link
Contributor Author

groutr commented Dec 7, 2016

Thank you. I guess I got carried away. I'll do a fresh start and open a new PR.

@groutr groutr closed this Dec 8, 2016
@jorisvandenbossche jorisvandenbossche added this to the No action milestone Dec 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect sequence handling with MultiIndex.from_tuples
3 participants