def mean(x):
    """
    Return a numpy array of column mean.
    It does not affect if the array is one dimension

    Parameters
    ----------
    x : ndarray
        A numpy array instance

    Returns
    -------
    ndarray
        A 1 x n numpy array instance of column mean

    Examples
    --------
    >>> a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
    >>> np.array_equal(mean(a), [2, 5, 8])
    True
    >>> a = np.array([1, 2, 3])
    >>> np.array_equal(mean(a), [1, 2, 3])
    True

    """
    if x.ndim > 1 and len(x[0]) > 1:
        return np.mean(x, axis=1)
    return x