numpy.negative()

numpy.negative(x[, out]) = Numerical negative, element-wise. Parameters: x : array_like or scalar Input array. Returns: y : ndarray or scalar Returned array or scalar: y = -x. Examples >>> np.negative([1.,-1.]) array([-1., 1.])

numpy.nditer

class numpy.nditer [source] Efficient multi-dimensional iterator object to iterate over arrays. To get started using this object, see the introductory guide to array iteration. Parameters: op : ndarray or sequence of array_like The array(s) to iterate over. flags : sequence of str, optional Flags to control the behavior of the iterator. ?buffered? enables buffering when required. ?c_index? causes a C-order index to be tracked. ?f_index? causes a Fortran-order index to be tracked. ?mult

numpy.ndindex()

class numpy.ndindex(*shape) [source] An N-dimensional iterator object to index arrays. Given the shape of an array, an ndindex instance iterates over the N-dimensional index of the array. At each iteration a tuple of indices is returned, the last dimension is iterated over first. Parameters: `*args` : ints The size of each dimension of the array. See also ndenumerate, flatiter Examples >>> for index in np.ndindex(3, 2, 1): ... print(index) (0, 0, 0) (0, 1, 0) (1, 0, 0) (1

numpy.ndenumerate()

class numpy.ndenumerate(arr) [source] Multidimensional index iterator. Return an iterator yielding pairs of array coordinates and values. Parameters: arr : ndarray Input array. See also ndindex, flatiter Examples >>> a = np.array([[1, 2], [3, 4]]) >>> for index, x in np.ndenumerate(a): ... print(index, x) (0, 0) 1 (0, 1) 2 (1, 0) 3 (1, 1) 4 Methods next() Standard iterator method, returns the index tuple and array value.

numpy.ndarray

class numpy.ndarray [source] An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is an integer, a floating point number, or something else, etc.) Arrays should be constructed using array, zeros or empty (refer to the See Also section below). The parameters given here refer to a low-level method (ndarray(...)) for

numpy.nan_to_num()

numpy.nan_to_num(x) [source] Replace nan with zero and inf with finite numbers. Returns an array or scalar replacing Not a Number (NaN) with zero, (positive) infinity with a very large number and negative infinity with a very small (or negative) number. Parameters: x : array_like Input data. Returns: out : ndarray New Array with the same shape as x and dtype of the element in x with the greatest precision. If x is inexact, then NaN is replaced by zero, and infinity (-infinity) is repl

numpy.nanvar()

numpy.nanvar(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False) [source] Compute the variance along the specified axis, while ignoring NaNs. Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by default, otherwise over the specified axis. For all-NaN slices or slices with zero degrees of freedom, NaN is returned and a RuntimeWarning is raised. New in version 1.8.0. Parameters: a : array_like Ar

numpy.nansum()

numpy.nansum(a, axis=None, dtype=None, out=None, keepdims=0) [source] Return the sum of array elements over a given axis treating Not a Numbers (NaNs) as zero. In Numpy versions <= 1.8 Nan is returned for slices that are all-NaN or empty. In later versions zero is returned. Parameters: a : array_like Array containing numbers whose sum is desired. If a is not an array, a conversion is attempted. axis : int, optional Axis along which the sum is computed. The default is to compute the s

numpy.nanstd()

numpy.nanstd(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False) [source] Compute the standard deviation along the specified axis, while ignoring NaNs. Returns the standard deviation, a measure of the spread of a distribution, of the non-NaN array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis. For all-NaN slices or slices with zero degrees of freedom, NaN is returned and a RuntimeWarning is raised. New in version

numpy.nanpercentile()

numpy.nanpercentile(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, while ignoring nan values. Returns the qth percentile(s) of the array elements. New in version 1.9.0. 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.