擅长:python、mysql、java
<p>使用<a href="https://numpy.org/" rel="noreferrer">Numpy</a>对于快速数组操作,请检查以下示例:</p>
<pre><code>import numpy as np
lst = np.array([1,2,3,4,5,6,7,8])
# add 2 at all indices from 4 till the end of the array
lst[4:] += 2
print(lst)
# array([ 1, 2, 3, 4, 7, 8, 9, 10])
</code></pre>