Cannot assign values to numpy array using 3D masking and indexing
问题 I have an 3D array that is a mask. Additionally, I have some indices that encode where (array position) some values should be saved. Everything seems to be working fine, except that the output matrix is still empty after assigning the values to the desired positions. I can not see what I am missing here. I have also tried numpy.put with no luck. import numpy as np # Initialize output matrix (here the results will be stored) results = np.zeros((67, 67, 45)) # define the mask - where to put the