Basic functions

average (a, axis=None, weights=None, returned=0)

Computes the average along the indicated axis. If axis is None, average over the entire array. Inputs can be integer or floating types; result is type float. If weights are given, the result is sum(a*weights)/sum(weights). Therefore, weights must have shape equal to a.shape or be 1-d with length a.shape[axis]. Integer weights are converted to float. If returned is True, then return a tuple showing both the result and the sum of the weights (or count of the values). The shape of these two results will be the same.

Compute the covariance matrix of data in x. If x is a vector and y is None, then this function is equivalent to asarray(x).var(). Otherwise, x is interpreted as observations of several random variables. If rowvar is True (default), then the variables are in the rows and the observations of the variables are in the columns. Otherwise, the variables are in the columns and the observations are in the rows. If y is given then it is treated as another variable or set of variables to be added to x. By default, a so-called unbiased estimate of the covariance matrix is made. If bias is non-zero, then a biased normalization factor (with better mean-square error performance) is used instead. If X is a random vector, then the covariance matrix is defined as

It can be approximated as

where xi is an observation of X (as a column-vector), N is the number of observations made and P = N — 1 for an unbiased estimate or P = N for a biased (but lower mean-squared error) estimate.

Estimate the correlation coefficient of x. By default, each row of x contains a random variable with observations of the random variable in the columns of x. (If rowvar is False, the each column is a random variable with observations in the rows). The y argument can be used to append additional variables to x. The ith row and jth column of the correlation coefficient matrix is defined as

Cjj y/CuCjj where C is the covariance matrix. The rowvar and bias arguments are passed on to the cov function to estimate C.

Return a new array, sorted along the first axis. Equivalent to b=a.copy(); b.sort(0)

0 0

Post a comment