Skip to content
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

BUG: unstack fails for mixed dtype subset #7462

Closed
wants to merge 2 commits into from
Closed

BUG: unstack fails for mixed dtype subset #7462

wants to merge 2 commits into from

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Jun 14, 2014

closes #7405

@cpcloud cpcloud added this to the 0.14.1 milestone Jun 14, 2014
@cpcloud cpcloud self-assigned this Jun 14, 2014
@cpcloud
Copy link
Member Author

cpcloud commented Jun 14, 2014

@jreback ok with this?

@jreback
Copy link
Contributor

jreback commented Jun 14, 2014

weird that works -

@cpcloud
Copy link
Member Author

cpcloud commented Jun 14, 2014

there might be a better way to fix it ... i'll look a little deeper

@cpcloud
Copy link
Member Author

cpcloud commented Jun 14, 2014

this way makes more sense, since we want the result of an unstack op to return the requested levels taking into account the labels ... before this fix, wasn't doing that if the unstack index result was a single level (coming from a multiindex)

@jreback
Copy link
Contributor

jreback commented Jun 14, 2014

do u have an indexer? this is better done with take (though what u r doing should work if the level is unique I think)

@cpcloud
Copy link
Member Author

cpcloud commented Jun 14, 2014

if i understand what you mean by indexer then yes result_labels is a list of labels for each level that are indexer for the level

@cpcloud
Copy link
Member Author

cpcloud commented Jun 14, 2014

@jreback this ok? the length check is really only for the one case ... feels a bit strange, but i couldn't see another place to put the fix ... welcome a suggestion

@cpcloud
Copy link
Member Author

cpcloud commented Jun 14, 2014

you can't just use take because there could be nans in result_labels, in all other cases (so far) the length is equal, i guess in theory u could still have a nan if the lengths aren't equal

@cpcloud
Copy link
Member Author

cpcloud commented Jun 14, 2014

let me see if i can come up with a test for that last case

@jreback
Copy link
Contributor

jreback commented Jun 14, 2014

I guess it's fine

though maybe could add some tests to try to break it

@jreback
Copy link
Contributor

jreback commented Jun 22, 2014

looks ok...squash and merge

@cpcloud
Copy link
Member Author

cpcloud commented Jun 26, 2014

i'm not totally sure this is the best way to go about this .. i'll spend some time this weekend trying to break my impl

@jreback jreback modified the milestones: 0.15.0, 0.14.1, 0.15.1 Jul 1, 2014
@jreback
Copy link
Contributor

jreback commented Sep 4, 2014

@cpcloud status?

@jreback jreback modified the milestones: 0.15.1, 0.15.0 Sep 8, 2014
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 2, 2015
@jreback
Copy link
Contributor

jreback commented Apr 8, 2015

was originally closed by #9292

@jreback jreback closed this Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: unstacking with partial selection and mixed dtype gives "ValueError: shape of passed values ..."
2 participants