def mean_and_error(a1, a2):
    """calculate mean and error from two 1D array-like

    Examples
    --------
    >>> import pytraj as pt
    >>> a0 = [2, 4, 6]
    >>> a1 = [3, 5, 7]
    >>> mean_and_error(a0, a1)
    (4.5, 0.5)
    """
    import numpy as np
    mean = np.mean
    a1 = np.asarray(a1)
    a2 = np.asarray(a2)
    assert len(a1.shape) == len(a2.shape) == 1, '1D array'
    return mean(a1 + a2) / 2, mean(np.abs(a1 - a2)) / 2
