I need to make a multidimensional array of zeros.
For two (D=2) or three (D=3) dimensions, this is easy and I\'d use:
a = numpy.zeros(shape=(n,n)) <
>>> sh = (10, 10, 10, 10) >>> z1 = zeros(10000).reshape(*sh) >>> z1.shape (10, 10, 10, 10)
EDIT: while above is not wrong, it's just excessive. @mgilson's answer is better.