Is there a faster way to change the 0s in a linespace?
<p>I'm working with Jupyter Notebooks and I need to do some calculations using a <code>linspace</code> which go to <code>b</code> from <code>a</code>, the problem is that I get the Zero Division Error, so I was wondering if there was a faster way to change the 0s in a linespace, instead of going trough each element, check if it's a 0 and then change it with the smallest representable number?</p>

<pre><code>a= numpy.linspace(...)
zero_mask = a==0
</code></pre>

<p>is that what you mean?</p>

python numpy