def _reduce_dim(array):
    """
    Removes the empty axes added with the _exten_dim function, returning to the
    user an array with the same number of dimensions as the input array.

    Parameters
    ----------
    array : numpy.ndarray
        Array with numerical values of 1, 2 or 3 dimensions.

    Returns
    -------
    array : numpy.ndarray
        Array with numerical values of 1, 2 or 3 dimensions.

    """
    if array.ndim == 3:
        if array.shape[1:] == (1, 1):
            array = array[:, 0, 0]
        elif array.shape[2:] == (1, ):
            array = array[:, :, 0]
    elif array.ndim == 2:
        if array.shape[1:] == (1,):
            array = array[:, 0]
    else:
        pass

    return array