I have the following code:
r = numpy.zeros(shape = (width, height, 9))
It creates a width x height x 9 matrix filled with zero
width x height x 9
Another option is to use numpy.full, an option available in NumPy 1.8+
a = np.full([height, width, 9], np.nan)
This is pretty flexible and you can fill it with any other number that you want.