UnicodeWarning: Unicode equal comparison failed ... (numpy.float, Python 2.x)

Hello. In Python 2.x, comparing values such as `numpy.float64``` (and return values such as scipy.sqrt```) with unicode literals gives ```UnicodeWarning``` It seems to be. On the other hand, the return value of ``` math.sqrt``` is float, so it's okay.

$ python --version
Python 2.7.11
$ python -c "from __future__ import unicode_literals;import math;x=math.sqrt(1);print x.__class__, x=='one'"
<type 'float'> False
$ python -c "from __future__ import unicode_literals;import scipy;x=scipy.sqrt(1);print x.__class__, x=='one'"
-c:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
<type 'numpy.float64'> False

Recommended Posts

UnicodeWarning: Unicode equal comparison failed ... (numpy.float, Python 2.x)
First Python 3 ~ First comparison ~
pangolin x python x mac os build failed memorandum unsolved