def whiten(obs, check_finite=True):
 obs = _asarray_validated(obs, check_finite=check_finite)
 std_dev = np.std(obs, axis=0)
 zero_std_mask = (std_dev == 0)
 if zero_std_mask.any():
  std_dev[zero_std_mask] = 1.0
  warnings.warn('Some columns have standard deviation zero. The values of these columns will not change.', RuntimeWarning)
 return (obs / std_dev)

def whiten ( obs , check_finite = True ) : obs = _asarray_validated ( obs , check_finite = check_finite ) std_dev = np . std ( obs , axis = 0 ) zero_std_mask = ( std_dev == 0 ) if zero_std_mask . any ( ) : std_dev [ zero_std_mask ] = 1.0 warnings . warn ( 'Some columns have standard deviation zero. The values of these columns will not change.' , RuntimeWarning ) return ( obs / std_dev )
normalize a group of observations on a per feature basis .