Skip to content

Series/DataFrame repr fails for MultiIndex level names with unicode #1736

@lodagro

Description

@lodagro
In [34]: tuples = [t for t in product(range(2), range(2))]

In [35]: index = pandas.MultiIndex.from_tuples(tuples, names=[u'\u0394', 'i1'])

In [36]: df = pandas.DataFrame(np.random.randn(4,4), index=index)

In [37]: s = pandas.Series(range(4), index=index)

In[38]: df
...
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0394' in position 0: ordinal not in range(128)

In[38]: s
...
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0394' in position 0: ordinal not in range(128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions