Skip to content

BUG: unstack on unicode name level breaks #9856

Closed
@jreback

Description

@jreback

xref #9650

In [62]: i = pd.MultiIndex(
    levels=[[u'foo', u'bar'], [u'one', u'two'], [u'a', u'b']],
    labels=[[0, 0, 1, 1], [0, 1, 0, 1], [1, 0, 1, 0]],
    names=[u'first', u'second', u'third'])

In [63]: s = pd.Series(0, index=i)

In [64]: s.unstack([1,2]).stack(0)
KeyError: 'Level t not found'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions