def manual_mean(arr):
    """
    Compute mean (average) of all elements in the given 2D array.

    Parameters
    ----------
    arr : ndarray

    Returns
    -------
    float
        the mean of all the elements in the array
    """
    the_sum = 0
    for i in range(0, arr.shape[0]):
        for j in range(0, arr.shape[1]):
            the_sum += arr[i, j]
    return the_sum / arr.size