def contrast_diff_mean(nm):
 return (np.eye(nm) - (np.ones((nm, nm)) / nm))

def contrast_diff_mean ( nm ) : return ( np . eye ( nm ) - ( np . ones ( ( nm , nm ) ) / nm ) )
contrast or restriction matrix for all against mean comparison parameters nm : int returns contr : ndarray .