title: Append sum of rows and columns to matrix
body: <p>I have (n,n) numpy array. I want to append a column vector where each element in it is the sum of the corresponding rows. I also append a row vector to the end of the matrix which is a sum of the corresponding columns. However, appending these 1D arrays is not compatible from a dimensional stand point. I want to append these, but have a matrix where the point (-1,-1) is the sum of either the last row or column (as they are equal).</p>
  
  <p>Example;</p>
  
  <pre><code>x = np.random.randint(5, size=(4, 4))
  columns = np.sum(x,axis=1)
  rows = np.sum(np.transpose(x),axis=1)
  </code></pre>