Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

use reshape in python with zeros

import numpy as np
...
shape = (6, 6) #This will be some pre-determined size
sigma = np.diag(S) #diagonalise the matrix - this works
sigma.resize(shape) #Resize the matrix and fill with zeros
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #reshape #python #zeros
ADD COMMENT
Topic
Name
8+3 =