I have two arrays of gridded data 'A' and 'B' of the same dimensions (1440, 400). I want to create a new array 'C' of the same dimension (1440, 400) where C contains the values from grid points of A that are only greater than B for the same grid point. If A < B, the values of A need to be replaced by NaN in C. Using the following code
C = A[A>B]
gives a one-dimensional array. In my case, it gives an array of shape (2362,).