numpy.array_repr()

numpy.array_repr(arr, max_line_width=None, precision=None, suppress_small=None) [source] Return the string representation of an array. Parameters: arr : ndarray Input array. max_line_width : int, optional The maximum number of columns the string should span. Newline characters split the string appropriately after array elements. precision : int, optional Floating point precision. Default is the current printing precision (usually 8), which can be altered using set_printoptions. suppr

numpy.array_equiv()

numpy.array_equiv(a1, a2) [source] Returns True if input arrays are shape consistent and all elements equal. Shape consistent means they are either the same shape, or one input array can be broadcasted to create the same shape as the other one. Parameters: a1, a2 : array_like Input arrays. Returns: out : bool True if equivalent, False otherwise. Examples >>> np.array_equiv([1, 2], [1, 2]) True >>> np.array_equiv([1, 2], [1, 3]) False Showing the shape equivalence:

numpy.array_equal()

numpy.array_equal(a1, a2) [source] True if two arrays have the same shape and elements, False otherwise. Parameters: a1, a2 : array_like Input arrays. Returns: b : bool Returns True if the arrays are equal. See also allclose Returns True if two arrays are element-wise equal within a tolerance. array_equiv Returns True if input arrays are shape consistent and all elements equal. Examples >>> np.array_equal([1, 2], [1, 2]) True >>> np.array_equal(np.array([1,

numpy.array2string()

numpy.array2string(a, max_line_width=None, precision=None, suppress_small=None, separator=' ', prefix='', style=, formatter=None) [source] Return a string representation of an array. Parameters: a : ndarray Input array. max_line_width : int, optional The maximum number of columns the string should span. Newline characters splits the string appropriately after array elements. precision : int, optional Floating point precision. Default is the current printing precision (usually 8), whic

numpy.array()

numpy.array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0) Create an array. Parameters: object : array_like An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence. dtype : data-type, optional The desired data-type for the array. If not given, then the type will be determined as the minimum type required to hold the objects in the sequence. This argument can only be used to ?upcast? the array. For d

numpy.around()

numpy.around(a, decimals=0, out=None) [source] Evenly round to the given number of decimals. Parameters: a : array_like Input data. decimals : int, optional Number of decimal places to round to (default: 0). If decimals is negative, it specifies the number of positions to the left of the decimal point. out : ndarray, optional Alternative output array in which to place the result. It must have the same shape as the expected output, but the type of the output values will be cast if nece

numpy.argwhere()

numpy.argwhere(a) [source] Find the indices of array elements that are non-zero, grouped by element. Parameters: a : array_like Input data. Returns: index_array : ndarray Indices of elements that are non-zero. Indices are grouped by element. See also where, nonzero Notes np.argwhere(a) is the same as np.transpose(np.nonzero(a)). The output of argwhere is not suitable for indexing arrays. For this purpose use where(a) instead. Examples >>> x = np.arange(6).reshape(2,3) >

numpy.argsort()

numpy.argsort(a, axis=-1, kind='quicksort', order=None) [source] Returns the indices that would sort an array. Perform an indirect sort along the given axis using the algorithm specified by the kind keyword. It returns an array of indices of the same shape as a that index data along the given axis in sorted order. Parameters: a : array_like Array to sort. axis : int or None, optional Axis along which to sort. The default is -1 (the last axis). If None, the flattened array is used. kind

numpy.argpartition()

numpy.argpartition(a, kth, axis=-1, kind='introselect', order=None) [source] Perform an indirect partition along the given axis using the algorithm specified by the kind keyword. It returns an array of indices of the same shape as a that index data along the given axis in partitioned order. New in version 1.8.0. Parameters: a : array_like Array to sort. kth : int or sequence of ints Element index to partition by. The kth element will be in its final sorted position and all smaller ele

numpy.argmin()

numpy.argmin(a, axis=None, out=None) [source] Returns the indices of the minimum values along an axis. Parameters: a : array_like Input array. axis : int, optional By default, the index is into the flattened array, otherwise along the specified axis. out : array, optional If provided, the result will be inserted into this array. It should be of the appropriate shape and dtype. Returns: index_array : ndarray of ints Array of indices into the array. It has the same shape as a.shape