Reputation: 3324
I'm printing a dataframe in Python 2.7/Ubuntu 14:
from pandas import *
import math, numpy
print DataFrame(com).fillna(0)
which gives lots of output like the following:
My questions is: why do some emoticons display correctly whereas some display as rectangles with hex characters in them?
Upvotes: 1
Views: 133
Reputation: 414625
The output shows that python
have printed all 6 emoticons successfully but your environment (font) can't display them i.e., the issue can be fixed without changing the code by updating the settings (choosing a different font)
$ python2 -c "for codepoint in range(0x1f63f, 0x1f645): print unichr(codepoint)"
πΏ
π
π
π
π
π
Note: U+1F643 UPSIDE-DOWN FACE and U+1F644 FACE WITH ROLLING EYES are introduced only in Unicode 8.0 standard (Released: 2015 June 17)βit is likely that most fonts do not support them. You could install Glyphs above the Unicode Basic Multilingual Plane to see the glyphs. Here's how it looks like in my terminal:
On the phone:
Upvotes: 1
Reputation: 799120
Because you don't have any font that includes those glyphs, or for whatever reason the font substitution engine on your system has decided to not pull in the glyphs from another font. The missing characters were added in Unicode 7.0 and so it is likely that no font on your system has glyphs for them yet.
Upvotes: 2