numpy.count_nonzero()

numpy.count_nonzero(a) Counts the number of non-zero values in the array a. Parameters: a : array_like The array for which to count non-zeros. Returns: count : int or array of int Number of non-zero values in the array. See also nonzero Return the coordinates of all the non-zero values. Examples >>> np.count_nonzero(np.eye(4)) 4 >>> np.count_nonzero([[0,1,7,0,0],[3,0,0,2,19]]) 5

numpy.correlate()

numpy.correlate(a, v, mode='valid') [source] Cross-correlation of two 1-dimensional sequences. This function computes the correlation as generally defined in signal processing texts: c_{av}[k] = sum_n a[n+k] * conj(v[n]) with a and v sequences being zero-padded where necessary and conj being the conjugate. Parameters: a, v : array_like Input sequences. mode : {?valid?, ?same?, ?full?}, optional Refer to the convolve docstring. Note that the default is ?valid?, unlike convolve, which us

numpy.cos()

numpy.cos(x[, out]) = Cosine element-wise. Parameters: x : array_like Input array in radians. out : ndarray, optional Output array of same shape as x. Returns: y : ndarray The corresponding cosine values. Raises: ValueError: invalid return array shape if out is provided and out.shape != x.shape (See Examples) Notes If out is provided, the function writes the result into it, and returns a reference to out. (See Examples) References M. Abramowitz and I. A. Stegun, Handbook of M

numpy.core.records.fromstring()

numpy.core.records.fromstring(datastring, dtype=None, shape=None, offset=0, formats=None, names=None, titles=None, aligned=False, byteorder=None) [source] create a (read-only) record array from binary data contained in a string

numpy.corrcoef()

numpy.corrcoef(x, y=None, rowvar=1, bias=, ddof=) [source] Return Pearson product-moment correlation coefficients. Please refer to the documentation for cov for more detail. The relationship between the correlation coefficient matrix, R, and the covariance matrix, C, is The values of R are between -1 and 1, inclusive. Parameters: x : array_like A 1-D or 2-D array containing multiple variables and observations. Each row of x represents a variable, and each column a single observation of

numpy.core.records.fromarrays()

numpy.core.records.fromarrays(arrayList, dtype=None, shape=None, formats=None, names=None, titles=None, aligned=False, byteorder=None) [source] create a record array from a (flat) list of arrays >>> x1=np.array([1,2,3,4]) >>> x2=np.array(['a','dd','xyz','12']) >>> x3=np.array([1.1,2,3,4]) >>> r = np.core.records.fromarrays([x1,x2,x3],names='a,b,c') >>> print(r[1]) (2, 'dd', 2.0) >>> x1[1]=34 >>> r.a array([1, 2, 3, 4])

numpy.core.records.fromrecords()

numpy.core.records.fromrecords(recList, dtype=None, shape=None, formats=None, names=None, titles=None, aligned=False, byteorder=None) [source] create a recarray from a list of records in text form The data in the same field can be heterogeneous, they will be promoted to the highest data type. This method is intended for creating smaller record arrays. If used to create large array without formats defined r=fromrecords([(2,3.,?abc?)]*100000) it can be slow. If formats is None, then this wil

numpy.core.records.fromfile()

numpy.core.records.fromfile(fd, dtype=None, shape=None, offset=0, formats=None, names=None, titles=None, aligned=False, byteorder=None) [source] Create an array from binary file data If file is a string then that file is opened, else it is assumed to be a file object. >>> from tempfile import TemporaryFile >>> a = np.empty(10,dtype='f8,i4,a5') >>> a[5] = (0.5,10,'abcde') >>> >>> fd=TemporaryFile() >>> a = a.newbyteorder('<') >>&

numpy.core.defchararray.zfill()

numpy.core.defchararray.zfill(a, width) [source] Return the numeric string left-filled with zeros Calls str.zfill element-wise. Parameters: a : array_like, {str, unicode} Input array. width : int Width of string to left-fill elements in a. Returns: out : ndarray, {str, unicode} Output array of str or unicode, depending on input type See also str.zfill

numpy.core.records.array()

numpy.core.records.array(obj, dtype=None, shape=None, offset=0, strides=None, formats=None, names=None, titles=None, aligned=False, byteorder=None, copy=True) [source] Construct a record array from a wide-variety of objects.