numpy.allclose()

numpy.allclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False) [source] Returns True if two arrays are element-wise equal within a tolerance. The tolerance values are positive, typically very small numbers. The relative difference (rtol * abs(b)) and the absolute difference atol are added together to compare against the absolute difference between a and b. If either array contains one or more NaNs, False is returned. Infs are treated as equal if they are in the same place and of the same sig

ndarray.argpartition()

ndarray.argpartition(kth, axis=-1, kind='introselect', order=None) Returns the indices that would partition this array. Refer to numpy.argpartition for full documentation. New in version 1.8.0. See also numpy.argpartition equivalent function

numpy.random.randint()

numpy.random.randint(low, high=None, size=None, dtype='l') Return random integers from low (inclusive) to high (exclusive). Return random integers from the ?discrete uniform? distribution of the specified dtype in the ?half-open? interval [low, high). If high is None (the default), then results are from [0, low). Parameters: low : int Lowest (signed) integer to be drawn from the distribution (unless high=None, in which case this parameter is the highest such integer). high : int, optiona

Financial functions

Simple financial functions fv(rate, nper, pmt, pv[, when]) Compute the future value. pv(rate, nper, pmt[, fv, when]) Compute the present value. npv(rate, values) Returns the NPV (Net Present Value) of a cash flow series. pmt(rate, nper, pv[, fv, when]) Compute the payment against loan principal plus interest. ppmt(rate, per, nper, pv[, fv, when]) Compute the payment against loan principal. ipmt(rate, per, nper, pv[, fv, when]) Compute the interest portion of a payment. irr(values) Retu

Iterating Over Arrays

The iterator object nditer, introduced in NumPy 1.6, provides many flexible ways to visit all the elements of one or more arrays in a systematic fashion. This page introduces some basic ways to use the object for computations on arrays in Python, then concludes with how one can accelerate the inner loop in Cython. Since the Python exposure of nditer is a relatively straightforward mapping of the C array iterator API, these ideas will also provide help working with array iteration from C or C++

numpy.diag_indices()

numpy.diag_indices(n, ndim=2) [source] Return the indices to access the main diagonal of an array. This returns a tuple of indices that can be used to access the main diagonal of an array a with a.ndim >= 2 dimensions and shape (n, n, ..., n). For a.ndim = 2 this is the usual diagonal, for a.ndim > 2 this is the set of indices to access a[i, i, ..., i] for i = [0..n-1]. Parameters: n : int The size, along each dimension, of the arrays for which the returned indices can be used. ndi

numpy.random.laplace()

numpy.random.laplace(loc=0.0, scale=1.0, size=None) Draw samples from the Laplace or double exponential distribution with specified location (or mean) and scale (decay). The Laplace distribution is similar to the Gaussian/normal distribution, but is sharper at the peak and has fatter tails. It represents the difference between two independent, identically distributed exponential random variables. Parameters: loc : float, optional The position, , of the distribution peak. scale : float, o

Hermite.degree()

Hermite.degree() [source] The degree of the series. New in version 1.5.0. Returns: degree : int Degree of the series, one less than the number of coefficients.

numpy.compress()

numpy.compress(condition, a, axis=None, out=None) [source] Return selected slices of an array along given axis. When working along a given axis, a slice along that axis is returned in output for each index where condition evaluates to True. When working on a 1-D array, compress is equivalent to extract. Parameters: condition : 1-D array of bools Array that selects which entries to return. If len(condition) is less than the size of a along the given axis, then output is truncated to the le

Laguerre.mapparms()

Laguerre.mapparms() [source] Return the mapping parameters. The returned values define a linear map off + scl*x that is applied to the input arguments before the series is evaluated. The map depends on the domain and window; if the current domain is equal to the window the resulting map is the identity. If the coefficients of the series instance are to be used by themselves outside this class, then the linear function must be substituted for the x in the standard representation of the base