numpy.roll()

numpy.roll(a, shift, axis=None) [source] Roll array elements along a given axis. Elements that roll beyond the last position are re-introduced at the first. Parameters: a : array_like Input array. shift : int The number of places by which elements are shifted. axis : int, optional The axis along which elements are shifted. By default, the array is flattened before shifting, after which the original shape is restored. Returns: res : ndarray Output array, with the same shape as a.

numpy.rint()

numpy.rint(x[, out]) = Round elements of the array to the nearest integer. Parameters: x : array_like Input array. Returns: out : ndarray or scalar Output array is same shape and type as x. See also ceil, floor, trunc Examples >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) >>> np.rint(a) array([-2., -2., -0., 0., 2., 2., 2.])

numpy.right_shift()

numpy.right_shift(x1, x2[, out]) = Shift the bits of an integer to the right. Bits are shifted to the right x2. Because the internal representation of numbers is in binary format, this operation is equivalent to dividing x1 by 2**x2. Parameters: x1 : array_like, int Input values. x2 : array_like, int Number of bits to remove at the right of x1. Returns: out : ndarray, int Return x1 with bits shifted x2 times to the right. See also left_shift Shift the bits of an integer to th

numpy.result_type()

numpy.result_type(*arrays_and_dtypes) Returns the type that results from applying the NumPy type promotion rules to the arguments. Type promotion in NumPy works similarly to the rules in languages like C++, with some slight differences. When both scalars and arrays are used, the array?s type takes precedence and the actual value of the scalar is taken into account. For example, calculating 3*a, where a is an array of 32-bit floats, intuitively should result in a 32-bit float output. If the

numpy.restoredot()

numpy.restoredot() [source] Restore dot, vdot, and innerproduct to the default non-BLAS implementations. Typically, the user will only need to call this when troubleshooting and installation problem, reproducing the conditions of a build without an accelerated BLAS, or when being very careful about benchmarking linear algebra operations. Note Deprecated in Numpy 1.10 The cblas functions have been integrated into the multarray module and restoredot now longer does anything. It will be remov

numpy.resize()

numpy.resize(a, new_shape) [source] Return a new array with the specified shape. If the new array is larger than the original array, then the new array is filled with repeated copies of a. Note that this behavior is different from a.resize(new_shape) which fills with zeros instead of repeated copies of a. Parameters: a : array_like Array to be resized. new_shape : int or tuple of int Shape of resized array. Returns: reshaped_array : ndarray The new array is formed from the data in t

numpy.reshape()

numpy.reshape(a, newshape, order='C') [source] Gives a new shape to an array without changing its data. Parameters: a : array_like Array to be reshaped. newshape : int or tuple of ints The new shape should be compatible with the original shape. If an integer, then the result will be a 1-D array of that length. One shape dimension can be -1. In this case, the value is inferred from the length of the array and remaining dimensions. order : {?C?, ?F?, ?A?}, optional Read the elements of

numpy.require()

numpy.require(a, dtype=None, requirements=None) [source] Return an ndarray of the provided type that satisfies requirements. This function is useful to be sure that an array with the correct flags is returned for passing to compiled code (perhaps through ctypes). Parameters: a : array_like The object to be converted to a type-and-requirement-satisfying array. dtype : data-type The required data-type. If None preserve the current dtype. If your application requires the data to be in nati

numpy.repeat()

numpy.repeat(a, repeats, axis=None) [source] Repeat elements of an array. Parameters: a : array_like Input array. repeats : int or array of ints The number of repetitions for each element. repeats is broadcasted to fit the shape of the given axis. axis : int, optional The axis along which to repeat values. By default, use the flattened input array, and return a flat output array. Returns: repeated_array : ndarray Output array which has the same shape as a, except along the given a

numpy.remainder()

numpy.remainder(x1, x2[, out]) = Return element-wise remainder of division. Computes the remainder complementary to the floor_divide function. It is equivalent to the Python modulus operator``x1 % x2`` and has the same sign as the divisor x2. It should not be confused with the Matlab(TM) rem function. Parameters: x1 : array_like Dividend array. x2 : array_like Divisor array. out : ndarray, optional Array into which the output is placed. Its type is preserved and it must be of the rig