Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #preallocate #numpy #array
ADD COMMENT
Topic
Name
4+1 =