Is there a python method to set the specified elements to be some value in a list?
<p>numpy has a function to set the specified elements to be some value</p>

<pre><code>a=numpy.zeros(10)
numpy.put(a, [2,3],1)
</code></pre>

<p>However, this method will directly change 'a' and return None if succeed.</p>

<p>Is there anyway we can keep 'a' intact and return the new array instead?</p>

<p>(I don't have to use numpy, and least dependency will be more preferred)</p>
