lib/matplotlib/mlab.py
def prepca(P, frac=0):
    """

    WARNING: this function is deprecated -- please see class PCA instead

    Compute the principal components of *P*.  *P* is a (*numVars*,
    *numObs*) array.  *frac* is the minimum fraction of variance that a
    component must contain to be included.

    Return value is a tuple of the form (*Pcomponents*, *Trans*,
    *fracVar*) where:

      - *Pcomponents* : a (numVars, numObs) array

      - *Trans* : the weights matrix, ie, *Pcomponents* = *Trans* *
         *P*

      - *fracVar* : the fraction of the variance accounted for by each
         component returned

    A similar function of the same name was in the Matlab (TM)
    R13 Neural Network Toolbox but is not found in later versions;
    its successor seems to be called "processpcs".
    """
    warnings.warn('This function is deprecated -- see class PCA instead')
    U,s,v = np.linalg.svd(P)
    varEach = s**2/P.shape[1]
    totVar = varEach.sum()
    fracVar = varEach/totVar
    ind = slice((fracVar>=frac).sum())
    # select the components that are greater
    Trans = U[:,ind].transpose()
    # The transformed data
    Pcomponents = np.dot(Trans,P)
    return Pcomponents, Trans, fracVar[ind]


    WARNING: this function is deprecated -- please see class PCA instead

    Compute the principal components of *P*.  *P* is a (*numVars*,
    *numObs*) array.  *frac* is the minimum fraction of variance that a
    component must contain to be included.

    Return value is a tuple of the form (*Pcomponents*, *Trans*,
    *fracVar*) where:

      - *Pcomponents* : a (numVars, numObs) array

      - *Trans* : the weights matrix, ie, *Pcomponents* = *Trans* *
         *P*

      - *fracVar* : the fraction of the variance accounted for by each
         component returned

    A similar function of the same name was in the Matlab (TM)
    R13 Neural Network Toolbox but is not found in later versions;
    its successor seems to be called "processpcs".
    
this function is deprecated -- please see class PCA instead
Compute the principal components of *P*.



*Pcomponents* : a (numVars, numObs) array



*fracVar* : the fraction of the variance accounted for by each
component returned

A similar function of the same name was in the Matlab (TM)
R13 Neural Network Toolbox but is not found in later versions;
its successor seems to be called "processpcs".
this function is deprecated -- please see class PCA instead Compute the principal components of * P * . * Pcomponents * : a ( numVars numObs ) array * fracVar * : the fraction of the variance accounted for by each component returned A similar function of the same name was in the Matlab ( TM ) R13 Neural Network Toolbox but is not found in later versions ; its successor seems to be called " processpcs " .
def prepca(P, frac=0):
    warnings.warn('This function is deprecated -- see class PCA instead')
    U,s,v = np.linalg.svd(P)
    varEach = s**2/P.shape[1]
    totVar = varEach.sum()
    fracVar = varEach/totVar
    ind = slice((fracVar>=frac).sum())
    Trans = U[:,ind].transpose()
    Pcomponents = np.dot(Trans,P)
    return Pcomponents, Trans, fracVar[ind]
def prepca ( P , frac = 0 ) : warnings . warn ( 'This function is deprecated -- see class PCA instead' ) U , s , v = np . linalg . svd ( P ) varEach = s ** 2 / P . shape [ 1 ] totVar = varEach . sum ( ) fracVar = varEach / totVar ind = slice ( ( fracVar >= frac ) . sum ( ) ) Trans = U [ : , ind ] . transpose ( ) Pcomponents = np . dot ( Trans , P ) return Pcomponents , Trans , fracVar [ ind ]
WARNING: this function is deprecated -- please see class PCA instead
Compute the principal components of *P*.
WARNING : this function is deprecated -- please see class PCA instead Compute the principal components of * P * .
"""

    WARNING: this function is deprecated -- please see class PCA instead

    Compute the principal components of *P*.  *P* is a (*numVars*,
    *numObs*) array.  *frac* is the minimum fraction of variance that a
    component must contain to be included.

    Return value is a tuple of the form (*Pcomponents*, *Trans*,
    *fracVar*) where:

      - *Pcomponents* : a (numVars, numObs) array

      - *Trans* : the weights matrix, ie, *Pcomponents* = *Trans* *
         *P*

      - *fracVar* : the fraction of the variance accounted for by each
         component returned

    A similar function of the same name was in the Matlab (TM)
    R13 Neural Network Toolbox but is not found in later versions;
    its successor seems to be called "processpcs".
    """ # select the components that are greater # The transformed data
P
frac