Return a numpy array of column median.
    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 median

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

def median(x):
    """
    Return a numpy array of column median.
    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 median

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

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