numpy.dot()

numpy.dot(a, b, out=None) Dot product of two arrays. For 2-D arrays it is equivalent to matrix multiplication, and for 1-D arrays to inner product of vectors (without complex conjugation). For N dimensions it is a sum product over the last axis of a and the second-to-last of b: dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m]) Parameters: a : array_like First argument. b : array_like Second argument. out : ndarray, optional Output argument. This must have the exact kind that would be ret

numpy.divide()

numpy.divide(x1, x2[, out]) = Divide arguments element-wise. Parameters: x1 : array_like Dividend array. x2 : array_like Divisor array. out : ndarray, optional Array into which the output is placed. Its type is preserved and it must be of the right shape to hold the output. See doc.ufuncs. Returns: y : ndarray or scalar The quotient x1/x2, element-wise. Returns a scalar if both x1 and x2 are scalars. See also seterr Set whether to raise or warn on overflow, underflow and di

numpy.diff()

numpy.diff(a, n=1, axis=-1) [source] Calculate the n-th discrete difference along given axis. The first difference is given by out[n] = a[n+1] - a[n] along the given axis, higher differences are calculated by using diff recursively. Parameters: a : array_like Input array n : int, optional The number of times values are differenced. axis : int, optional The axis along which the difference is taken, default is the last axis. Returns: diff : ndarray The n-th differences. The sh

numpy.digitize()

numpy.digitize(x, bins, right=False) Return the indices of the bins to which each value in input array belongs. Each index i returned is such that bins[i-1] <= x < bins[i] if bins is monotonically increasing, or bins[i-1] > x >= bins[i] if bins is monotonically decreasing. If values in x are beyond the bounds of bins, 0 or len(bins) is returned as appropriate. If right is True, then the right bin is closed so that the index i is such that bins[i-1] < x <= bins[i] or bins[i

numpy.diag_indices_from()

numpy.diag_indices_from(arr) [source] Return the indices to access the main diagonal of an n-dimensional array. See diag_indices for full details. Parameters: arr : array, at least 2-D See also diag_indices Notes New in version 1.4.0.

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.diagonal()

numpy.diagonal(a, offset=0, axis1=0, axis2=1) [source] Return specified diagonals. If a is 2-D, returns the diagonal of a with the given offset, i.e., the collection of elements of the form a[i, i+offset]. If a has more than two dimensions, then the axes specified by axis1 and axis2 are used to determine the 2-D sub-array whose diagonal is returned. The shape of the resulting array can be determined by removing axis1 and axis2 and appending an index to the right equal to the size of the res

numpy.diag()

numpy.diag(v, k=0) [source] Extract a diagonal or construct a diagonal array. See the more detailed documentation for numpy.diagonal if you use this function to extract a diagonal and wish to write to the resulting array; whether it returns a copy or a view depends on what version of numpy you are using. Parameters: v : array_like If v is a 2-D array, return a copy of its k-th diagonal. If v is a 1-D array, return a 2-D array with v on the k-th diagonal. k : int, optional Diagonal in qu

numpy.diagflat()

numpy.diagflat(v, k=0) [source] Create a two-dimensional array with the flattened input as a diagonal. Parameters: v : array_like Input data, which is flattened and set as the k-th diagonal of the output. k : int, optional Diagonal to set; 0, the default, corresponds to the ?main? diagonal, a positive (negative) k giving the number of the diagonal above (below) the main. Returns: out : ndarray The 2-D output array. See also diag MATLAB work-alike for 1-D and 2-D arrays. diag

numpy.delete()

numpy.delete(arr, obj, axis=None) [source] Return a new array with sub-arrays along an axis deleted. For a one dimensional array, this returns those entries not returned by arr[obj]. Parameters: arr : array_like Input array. obj : slice, int or array of ints Indicate which sub-arrays to remove. axis : int, optional The axis along which to delete the subarray defined by obj. If axis is None, obj is applied to the flattened array. Returns: out : ndarray A copy of arr with the elemen