RandomState.chisquare()

RandomState.chisquare(df, size=None) Draw samples from a chi-square distribution. When df independent random variables, each with standard normal distributions (mean 0, variance 1), are squared and summed, the resulting distribution is chi-square (see Notes). This distribution is often used in hypothesis testing. Parameters: df : int Number of degrees of freedom. size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.

RandomState.bytes()

RandomState.bytes(length) Return random bytes. Parameters: length : int Number of random bytes. Returns: out : str String of length length. Examples >>> np.random.bytes(10) ' eh\x85\x022SZ\xbf\xa4' #random

RandomState.binomial()

RandomState.binomial(n, p, size=None) Draw samples from a binomial distribution. Samples are drawn from a binomial distribution with specified parameters, n trials and p probability of success where n an integer >= 0 and p is in the interval [0,1]. (n may be input as a float, but it is truncated to an integer in use) Parameters: n : float (but truncated to an integer) parameter, >= 0. p : float parameter, >= 0 and <=1. size : int or tuple of ints, optional Output shape. If

RandomState.beta()

RandomState.beta(a, b, size=None) Draw samples from a Beta distribution. The Beta distribution is a special case of the Dirichlet distribution, and is related to the Gamma distribution. It has the probability distribution function where the normalisation, B, is the beta function, It is often seen in Bayesian inference and order statistics. Parameters: a : float Alpha, non-negative. b : float Beta, non-negative. size : int or tuple of ints, optional Output shape. If the given sha

Random sampling (numpy.random)

Simple random data rand(d0, d1, ..., dn) Random values in a given shape. randn(d0, d1, ..., dn) Return a sample (or samples) from the ?standard normal? distribution. randint(low[, high, size, dtype]) Return random integers from low (inclusive) to high (exclusive). random_integers(low[, high, size]) Random integers of type np.int between low and high, inclusive. random_sample([size]) Return random floats in the half-open interval [0.0, 1.0). random([size]) Return random floats in the hal

PyArrayObject

Several new types are defined in the C-code. Most of these are accessible from Python, but a few are not exposed due to their limited use. Every new Python type has an associated PyObject * with an internal structure that includes a pointer to a ?method table? that defines how the new object behaves in Python. When you receive a Python object into C code, you always get a pointer to a PyObject structure. Because a PyObject structure is very generic and defines only PyObject_HEAD, by itself it

Polynomials

Polynomials in NumPy can be created, manipulated, and even fitted using the Using the Convenience Classes of the numpy.polynomial package, introduced in NumPy 1.4. Prior to NumPy 1.4, numpy.poly1d was the class of choice and it is still available in order to maintain backward compatibility. However, the newer Polynomial package is more complete than numpy.poly1d and its convenience classes are better behaved in the numpy environment. Therefore Polynomial is recommended for new coding. Transit

Polynomial.__call__()

Polynomial.__call__(arg) [source]

Polynomial.truncate()

Polynomial.truncate(size) [source] Truncate series to length size. Reduce the series to length size by discarding the high degree terms. The value of size must be a positive integer. This can be useful in least squares where the coefficients of the high degree terms may be very small. Parameters: size : positive int The series is reduced to length size by discarding the high degree terms. The value of size must be a positive integer. Returns: new_series : series New instance of series

Polynomial.trim()

Polynomial.trim(tol=0) [source] Remove trailing coefficients Remove trailing coefficients until a coefficient is reached whose absolute value greater than tol or the beginning of the series is reached. If all the coefficients would be removed the series is set to [0]. A new series instance is returned with the new coefficients. The current instance remains unchanged. Parameters: tol : non-negative number. All trailing coefficients less than tol will be removed. Returns: new_series : se