def contrast_diff_mean(nm):
    '''contrast or restriction matrix for all against mean comparison

    Parameters
    ----------
    nm : int

    Returns
    -------
    contr : ndarray, 2d, (nm-1, nm)
       contrast matrix for all against mean comparisons

    '''
    return np.ones((nm,nm))/nm - np.eye(nm)
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/sandbox/stats/contrast_tools.py/contrast_diff_mean/swapped operands of `-`