Skip to content

Test added and patch to fix python-version-dependent issues when len ro... #9583

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

Merged
merged 1 commit into from
Mar 5, 2015

Conversation

cottrell
Copy link
Contributor

@cottrell cottrell commented Mar 3, 2015

...w/col_levels is 1.

The docs for sparse to_coo methods failed to build. There was some case (row_levels len 1) that failed in python 2.7 only that I failed to test (and I have been building docs in python 3). Have added test and patched. Also needed to expand the interator (list(map(... ) in the "# squish" line as there was some tupleizing differences between python 3 and 2.

Perhaps there is a better way to avoid these issues? Waiting for Travis.

@@ -54,7 +54,7 @@ def get_indexers(levels):
def _get_label_to_i_dict(labels, sort_labels=False):
""" Return OrderedDict of unique labels to number.
Optionally sort by label. """
labels = Index(map(tuple, labels)).unique().tolist() # squish
labels = Index(list(map(tuple, labels))).unique().tolist() # squish
if sort_labels:
Copy link
Contributor

Choose a reason for hiding this comment

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

use lmap, which imports from pandas.compat (and handles the 2/3 differences)

@jreback jreback added Bug Sparse Sparse Data Type labels Mar 4, 2015
@jreback jreback added this to the 0.16.0 milestone Mar 4, 2015
@cottrell
Copy link
Contributor Author

cottrell commented Mar 4, 2015

Put the lmap in. Will check the docs again once this is merged.

jreback added a commit that referenced this pull request Mar 5, 2015
Test added and patch to fix python-version-dependent issues when len ro...
@jreback jreback merged commit 827c854 into pandas-dev:master Mar 5, 2015
@jreback
Copy link
Contributor

jreback commented Mar 5, 2015

@cottrell thanks!

@cottrell cottrell deleted the to_coo_patch branch March 7, 2015 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants