Skip to content

plotting._stringify not unicode safe #1685

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
JoeGermuska opened this issue Jul 26, 2012 · 2 comments
Closed

plotting._stringify not unicode safe #1685

JoeGermuska opened this issue Jul 26, 2012 · 2 comments
Labels
Bug Unicode Unicode strings Visualization plotting
Milestone

Comments

@JoeGermuska
Copy link

/Users/germuska/.virtualenvs/data/lib/python2.6/site-packages/pandas/tools/plotting.pyc in _stringify(x)
1073 return '|'.join(str(y) for y in x)
1074 else:
-> 1075 return str(x)
1076
1077

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 1: ordinal not in range(128)

If labels can't be unicode, perhaps can a clearer error be thrown?

@changhiskhan
Copy link
Contributor

Matplotlib supports unicode so we don't have to limit pandas plotting functions either I think.
Would you be interested in making a pull request on this? You can use the stringify functionality in pandas.core.common as a reference

@lodagro
Copy link
Contributor

lodagro commented Aug 6, 2012

fixed

In [13]: df
Out[13]: 
c0     bar   
c1       Δ  Ε
i0 i1        
α  0     8  5
   1     6  5
β  2     2  4
   3     8  7
γ  4     1  8
   5     7  7
δ  6     9  3
   7     5  7

In [14]: df.plot(title=u'\u03A3')
Out[14]: <matplotlib.axes.AxesSubplot at 0xa01cbac>

plot

@lodagro lodagro closed this as completed in be94b91 Aug 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Unicode Unicode strings Visualization plotting
Projects
None yet
Development

No branches or pull requests

3 participants