I want to calculate the mean of non-zero values in a 2D array using an index from another 2d array and return these values to an array of same shape. For example,
Inp