how to make a new numpy array same size as a given array and fill it with a scalar value
<p>I have a numpy array with some random numbers, how can I create a new array with the same size and fill it with a single value?</p>

<p>I have the following code:</p>

<pre><code>A=np.array([[2,2],
            [2,2]])
B=np.copy(A)
B=B.fill(1)
</code></pre>

<p>I want to have a new array B with the same size as A but filled with 1s. However, it returns a <code>None</code> object. Same when using <code>np.full</code>.</p>