I have a function "func" that receives a list containing the number of rows of image called "matrix_image":
list_rows = range(N_rows)
Then, computation is done inside func and I get a new row of the resultant matrix representing an image.
def func(list_rows):
new_row = numpy.empty(N_columns)
....
....# some computation
....
return new_row
matrix_image = pool.map(func, list_n_rows )
"new_row" is correctly calculated inside func because I see values in debugger, but resultant matrix_image has shape: (list_n_rows,).
Filled with all values at None.
How to return a (1D numpy array) row from func to be appended into a resultant matrix (2D numpy array)?