numpy.poly1d()

class numpy.poly1d(c_or_r, r=0, variable=None) [source] A one-dimensional polynomial class. A convenience class, used to encapsulate ?natural? operations on polynomials so that said operations may take on their customary form in code (see Examples). Parameters: c_or_r : array_like The polynomial?s coefficients, in decreasing powers, or if the value of the second parameter is True, the polynomial?s roots (values where the polynomial evaluates to 0). For example, poly1d([1, 2, 3]) returns a

numpy.poly()

numpy.poly(seq_of_zeros) [source] Find the coefficients of a polynomial with the given sequence of roots. Returns the coefficients of the polynomial whose leading coefficient is one for the given sequence of zeros (multiple roots must be included in the sequence as many times as their multiplicity; see Examples). A square matrix (or array, which will be treated as a matrix) can also be given, in which case the coefficients of the characteristic polynomial of the matrix are returned. Paramet

numpy.pmt()

numpy.pmt(rate, nper, pv, fv=0, when='end') [source] Compute the payment against loan principal plus interest. Given: a present value, pv (e.g., an amount borrowed) a future value, fv (e.g., 0) an interest rate compounded once per period, of which there are nper total and (optional) specification of whether payment is made at the beginning (when = {?begin?, 1}) or the end (when = {?end?, 0}) of each period Return: the (fixed) periodic payment. Parameters: rate : array_like Rate of inte

numpy.place()

numpy.place(arr, mask, vals) [source] Change elements of an array based on conditional and input values. Similar to np.copyto(arr, vals, where=mask), the difference is that place uses the first N elements of vals, where N is the number of True values in mask, while copyto uses the elements where mask is True. Note that extract does the exact opposite of place. Parameters: arr : ndarray Array to put data into. mask : array_like Boolean mask array. Must have the same size as a. vals : 1-

numpy.piecewise()

numpy.piecewise(x, condlist, funclist, *args, **kw) [source] Evaluate a piecewise-defined function. Given a set of conditions and corresponding functions, evaluate each function on the input data wherever its condition is true. Parameters: x : ndarray The input domain. condlist : list of bool arrays Each boolean array corresponds to a function in funclist. Wherever condlist[i] is True, funclist[i](x) is used as the output value. Each boolean array in condlist selects a piece of x, and s

numpy.percentile()

numpy.percentile(a, q, axis=None, out=None, overwrite_input=False, interpolation='linear', keepdims=False) [source] Compute the qth percentile of the data along the specified axis. Returns the qth percentile(s) of the array elements. Parameters: a : array_like Input array or object that can be converted to an array. q : float in range of [0,100] (or sequence of floats) Percentile to compute, which must be between 0 and 100 inclusive. axis : {int, sequence of int, None}, optional Axis

numpy.partition()

numpy.partition(a, kth, axis=-1, kind='introselect', order=None) [source] Return a partitioned copy of an array. Creates a copy of the array with its elements rearranged in such a way that the value of the element in kth position is in the position it would be in a sorted array. All elements smaller than the kth element are moved before this element and all equal or greater are moved behind it. The ordering of the elements in the two partitions is undefined. New in version 1.8.0. Paramete

numpy.pad()

numpy.pad(array, pad_width, mode, **kwargs) [source] Pads an array. Parameters: array : array_like of rank N Input array pad_width : {sequence, array_like, int} Number of values padded to the edges of each axis. ((before_1, after_1), ... (before_N, after_N)) unique pad widths for each axis. ((before, after),) yields same before and after pad for each axis. (pad,) or int is a shortcut for before = after = pad width for all axes. mode : str or function One of the following string values

numpy.packbits()

numpy.packbits(myarray, axis=None) Packs the elements of a binary-valued array into bits in a uint8 array. The result is padded to full bytes by inserting zero bits at the end. Parameters: myarray : array_like An integer type array whose elements should be packed to bits. axis : int, optional The dimension over which bit-packing is done. None implies packing the flattened array. Returns: packed : ndarray Array of type uint8 whose elements represent bits corresponding to the logical

numpy.outer()

numpy.outer(a, b, out=None) [source] Compute the outer product of two vectors. Given two vectors, a = [a0, a1, ..., aM] and b = [b0, b1, ..., bN], the outer product [R55] is: [[a0*b0 a0*b1 ... a0*bN ] [a1*b0 . [ ... . [aM*b0 aM*bN ]] Parameters: a : (M,) array_like First input vector. Input is flattened if not already 1-dimensional. b : (N,) array_like Second input vector. Input is flattened if not already 1-dimensional. out : (M, N) ndarray, optional A loc