I have a numpy array that is roughly (x,y,z) = (100, 150, 25) and I want to find the maximum value of each x,y array element (ie, compare the [1][1] from all subarrays and find the maximum). I then want to save these values to a separate 2d array of shape (x, y) = (100, 150). I have included the below code as an example. Thanks!
import numpy as np
a = np.array([[[6, 7], [3, 4], [2, 7]], [[1, 2], [5, 8], [3, 5]]])
print(a)
#some function that finds the maximum of each element and saves it to a new 2d array
desired_output = np.array([[6,7], [5, 8], [3, 7]])
print(desired_output)