corrected for 1d mean on scipy