擅长:python、mysql、java
<p>您可以使用<code>math.log()</code>替换<code>numpy.log()</code>,这可能会引发错误
</p>
<pre><code>>>> import numpy
>>> numpy.log(0)
-inf
>>> numpy.__version__
'1.3.0'
>>> import math
>>> math.log(0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: math domain error
</code></pre>