"Divide by zero encountered in log" when not dividing by zero
<p>When I do:</p>

<pre><code>summing += yval * np.log(sigmoid(np.dot(w.transpose(), xi.transpose()))) + (1-yval)* np.log(1-sigmoid(np.dot(w.transpose(), xi.transpose())))
</code></pre>

<p>where there is no division, why do I get a "divide by zero encountered in log" error? As a result, <code>summing</code> becomes <code>[nan]</code>.</p>