擅长:python、mysql、java
<p>此代码在没有移动计数器的情况下给出相同的结果</p>
<pre><code>nbpoints = 3
Z=np.linspace(0,1.,10.)
Zstart = np.ones(nbpoints)
Zend = np.ones(nbpoints)
Zstart[Z[:nbpoints] < 1] = Z[:nbpoints][Z[:nbpoints] < 1]
Zend[Z[-nbpoints:] < 1] = Z[-nbpoints:][Z[-nbpoints:] < 1]
</code></pre>