SyntaxFix
Write A Post
Hire A Developer
Questions
Another option is to use numpy.full, an option available in NumPy 1.8+
numpy.full
a = np.full([height, width, 9], np.nan)
This is pretty flexible and you can fill it with any other number that you want.