numpy.degrees()

numpy.degrees(x[, out]) = Convert angles from radians to degrees. Parameters: x : array_like Input array in radians. out : ndarray, optional Output array of same shape as x. Returns: y : ndarray of floats The corresponding degree values; if out was supplied this is a reference to it. See also rad2deg equivalent function Examples Convert a radian array to degrees >>> rad = np.arange(12.)*np.pi/6 >>> np.degrees(rad) array([ 0., 30., 60., 90., 120.,

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

numpy.DataSource()

class numpy.DataSource(destpath='.') [source] A generic data source file (file, http, ftp, ...). DataSources can be local files or remote files/URLs. The files may also be compressed or uncompressed. DataSource hides some of the low-level details of downloading the file, allowing you to simply pass in a valid file path (or URL) and obtain a file object. Parameters: destpath : str or None, optional Path to the directory where the source file gets downloaded to for use. If destpath is None,

numpy.cumsum()

numpy.cumsum(a, axis=None, dtype=None, out=None) [source] Return the cumulative sum of the elements along a given axis. Parameters: a : array_like Input array. axis : int, optional Axis along which the cumulative sum is computed. The default (None) is to compute the cumsum over the flattened array. dtype : dtype, optional Type of the returned array and of the accumulator in which the elements are summed. If dtype is not specified, it defaults to the dtype of a, unless a has an integer

numpy.cumprod()

numpy.cumprod(a, axis=None, dtype=None, out=None) [source] Return the cumulative product of elements along a given axis. Parameters: a : array_like Input array. axis : int, optional Axis along which the cumulative product is computed. By default the input is flattened. dtype : dtype, optional Type of the returned array, as well as of the accumulator in which the elements are multiplied. If dtype is not specified, it defaults to the dtype of a, unless a has an integer dtype with a prec

numpy.c_

numpy.c_ = Translates slice objects to concatenation along the second axis. This is short-hand for np.r_['-1,2,0', index expression], which is useful because of its common occurrence. In particular, arrays will be stacked along their last axis after being upgraded to at least 2-D with 1?s post-pended to the shape (column vectors made out of 1-D arrays). For detailed documentation, see r_. Examples >>> np.c_[np.array([[1,2,3]]), 0, 0, np.array([[4,5,6]])] array([[1, 2, 3, 0, 0, 4,

numpy.ctypeslib.as_array()

numpy.ctypeslib.as_array(obj, shape=None) [source] Create a numpy array from a ctypes array or a ctypes POINTER. The numpy array shares the memory with the ctypes object. The size parameter must be given if converting from a ctypes POINTER. The size parameter is ignored if converting from a ctypes array numpy.ctypeslib.as_ctypes(obj) [source] Create and return a ctypes object from a numpy array. Actually anything that exposes the __array_interface__ is accepted. numpy.ctypeslib.ct

numpy.cross()

numpy.cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None) [source] Return the cross product of two (arrays of) vectors. The cross product of a and b in is a vector perpendicular to both a and b. If a and b are arrays of vectors, the vectors are defined by the last axis of a and b by default, and these axes can have dimensions 2 or 3. Where the dimension of either a or b is 2, the third component of the input vector is assumed to be zero and the cross product calculated accordingly. In cas

numpy.cosh()

numpy.cosh(x[, out]) = Hyperbolic cosine, element-wise. Equivalent to 1/2 * (np.exp(x) + np.exp(-x)) and np.cos(1j*x). Parameters: x : array_like Input array. Returns: out : ndarray Output array of same shape as x. Examples >>> np.cosh(0) 1.0 The hyperbolic cosine describes the shape of a hanging cable: >>> import matplotlib.pyplot as plt >>> x = np.linspace(-4, 4, 1000) >>> plt.plot(x, np.cosh(x)) >>> plt.show() (Source code, png, pdf

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