Preallocate numpy array
%timeit np.empty((80,80,300000),dtype='uint8')
%timeit np.zeros((80,80,300000),dtype='uint8')
%timeit np.ones((80,80,300000),dtype='uint8')
Happy Hornet