def ship_location(image): is_ship = np.sum(np.abs(image[185, :, :] - SHIP_COLOR), axis=1) == 0 w = np.argwhere(is_ship) return w[0][0] if len(w) == 1 else None