When following through the unmarked Exercise 6 - create_mask_from_window
I got this result using the recommended array type code Output = (a == np.max(a))
However when I ran the same function using the deprecated ‘for loop’ method;
mask = np.zeros((x.shape))
f=x.shape[0]
for i in range (f):
for j in range (f):
mask[i,j] = True if (x[i,j] == np.max(x)) else False
I got
Both methods pass the tests but each method produces a different output.
Looking at the output there seems to be two correct but different answers.
This is unscored so doesn’t matter in the course, but intrigues me.
Any helpful comments on where I am mistaken?
Edit
Notice the first method produces a 3 by 3 array and the second a 2 by 3 array
Ian