filterpy/stats/stats.py
def _to_cov(x,n):
    """ If x is a scalar, returns a covariance matrix generated from it
    as the identity matrix multiplied by x. The dimension will be nxn.
    If x is already a numpy array then it is returned unchanged.
    """
    try:
        x.shape
        if type(x) != np.ndarray:
            x = np.asarray(x)[0]
        return x
    except:
        return np.eye(n) * x
 If x is a scalar, returns a covariance matrix generated from it
    as the identity matrix multiplied by x. The dimension will be nxn.
    If x is already a numpy array then it is returned unchanged.
    
If x is a scalar, returns a covariance matrix generated from it
as the identity matrix multiplied by x. The dimension will be nxn.
If x is already a numpy array then it is returned unchanged.
If x is a scalar returns a covariance matrix generated from it as the identity matrix multiplied by x . The dimension will be nxn . If x is already a numpy array then it is returned unchanged .
def _to_cov(x,n):
    try:
        x.shape
        if type(x) != np.ndarray:
            x = np.asarray(x)[0]
        return x
    except:
        return np.eye(n) * x
def _to_cov ( x , n ) : try : x . shape if type ( x ) != np . ndarray : x = np . asarray ( x ) [ 0 ] return x except : return np . eye ( n ) * x
If x is a scalar, returns a covariance matrix generated from it
as the identity matrix multiplied by x.
If x is a scalar returns a covariance matrix generated from it as the identity matrix multiplied by x .
""" If x is a scalar, returns a covariance matrix generated from it
    as the identity matrix multiplied by x. The dimension will be nxn.
    If x is already a numpy array then it is returned unchanged.
    """
x
n