title: Python: Resize an existing array and fill with zeros
body: <p>I think that my issue should be really simple, yet I can not find any help
  on the Internet whatsoever.  I am very new to Python, so it is possible that
  I am missing something very obvious.</p>
  
  <p>I have an array, S, like this <code>[x x x] (one-dimensional)</code>.  I now create a 
  diagonal matrix, <code>sigma</code>, with <code>np.diag(S)</code> - so far, so good.  Now, I want to 
  resize this new diagonal array so that I can multiply it by another array that
  I have.</p>
  
  <pre><code>import numpy as np
  ...
  shape = np.shape((6, 6)) #This will be some pre-determined size
  sigma = np.diag(S) #diagonalise the matrix - this works
  my_sigma = sigma.resize(shape) #Resize the matrix and fill with zeros - returns "None" - why?
  </code></pre>
  
  <p>However, when I print the contents of <code>my_sigma</code>, I get <code>"None"</code>.  Can someone please
  point me in the right direction, because I can not imagine that this should be
  so complicated.</p>
  
  <p>Thanks in advance for any help!</p>
  
  <p>Casper</p>
  
  <p>Graphical:</p>
  
  <p>I have this: </p>
  
  <pre><code>[x x x]
  </code></pre>
  
  <p>I want this:</p>
  
  <pre><code>[x 0 0]
  [0 x 0]
  [0 0 x]
  [0 0 0]
  [0 0 0]
  [0 0 0] - or some similar size, but the diagonal elements are important.
  </code></pre>