numpy.take()

numpy.take(a, indices, axis=None, out=None, mode='raise') [source] Take elements from an array along an axis. This function does the same thing as ?fancy? indexing (indexing arrays using arrays); however, it can be easier to use if you need elements along a given axis. Parameters: a : array_like The source array. indices : array_like The indices of the values to extract. New in version 1.8.0. Also allow scalars for indices. axis : int, optional The axis over which to select values.

numpy.s_

numpy.s_ = A nicer way to build up index tuples for arrays. Note Use one of the two predefined instances index_exp or s_ rather than directly using IndexExpression. For any index combination, including slicing and axis insertion, a[indices] is the same as a[np.index_exp[indices]] for any array a. However, np.index_exp[indices] can be used anywhere in Python code and returns a tuple of slice objects that can be used in the construction of complex index expressions. Parameters: maketuple

numpy.swapaxes()

numpy.swapaxes(a, axis1, axis2) [source] Interchange two axes of an array. Parameters: a : array_like Input array. axis1 : int First axis. axis2 : int Second axis. Returns: a_swapped : ndarray For Numpy >= 1.10, if a is an ndarray, then a view of a is returned; otherwise a new array is created. For earlier Numpy versions a view of a is returned only if the order of the axes is changed, otherwise the input array is returned. Examples >>> x = np.array([[1,2,3]]) >&g

numpy.sum()

numpy.sum(a, axis=None, dtype=None, out=None, keepdims=False) [source] Sum of array elements over a given axis. Parameters: a : array_like Elements to sum. axis : None or int or tuple of ints, optional Axis or axes along which a sum is performed. The default, axis=None, will sum all of the elements of the input array. If axis is negative it counts from the last to the first axis. New in version 1.7.0. If axis is a tuple of ints, a sum is performed on all of the axes specified in the t

numpy.subtract()

numpy.subtract(x1, x2[, out]) = Subtract arguments, element-wise. Parameters: x1, x2 : array_like The arrays to be subtracted from each other. Returns: y : ndarray The difference of x1 and x2, element-wise. Returns a scalar if both x1 and x2 are scalars. Notes Equivalent to x1 - x2 in terms of array broadcasting. Examples >>> np.subtract(1.0, 4.0) -3.0 >>> x1 = np.arange(9.0).reshape((3, 3)) >>> x2 = np.arange(3.0) >>> np.subtract(x1, x2) array(

numpy.std()

numpy.std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False) [source] Compute the standard deviation along the specified axis. Returns the standard deviation, a measure of the spread of a distribution, of the array elements. The standard deviation is computed for the flattened array by default, otherwise over the specified axis. Parameters: a : array_like Calculate the standard deviation of these values. axis : None or int or tuple of ints, optional Axis or axes along which the

numpy.stack()

numpy.stack(arrays, axis=0) [source] Join a sequence of arrays along a new axis. The axis parameter specifies the index of the new axis in the dimensions of the result. For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension. New in version 1.10.0. Parameters: arrays : sequence of array_like Each array must have the same shape. axis : int, optional The axis in the result array along which the input arrays are stacked. Returns: stacked : nd

numpy.squeeze()

numpy.squeeze(a, axis=None) [source] Remove single-dimensional entries from the shape of an array. Parameters: a : array_like Input data. axis : None or int or tuple of ints, optional New in version 1.7.0. Selects a subset of the single-dimensional entries in the shape. If an axis is selected with shape entry greater than one, an error is raised. Returns: squeezed : ndarray The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or

numpy.square()

numpy.square(x[, out]) = Return the element-wise square of the input. Parameters: x : array_like Input data. Returns: out : ndarray Element-wise x*x, of the same shape and dtype as x. Returns scalar if x is a scalar. See also numpy.linalg.matrix_power, sqrt, power Examples >>> np.square([-1j, 1]) array([-1.-0.j, 1.+0.j])

numpy.sqrt()

numpy.sqrt(x[, out]) = Return the positive square-root of an array, element-wise. Parameters: x : array_like The values whose square-roots are required. out : ndarray, optional Alternate array object in which to put the result; if provided, it must have the same shape as x Returns: y : ndarray An array of the same shape as x, containing the positive square-root of each element in x. If any element in x is complex, a complex array is returned (and the square-roots of negative reals