matrix.strides

matrix.strides Tuple of bytes to step in each dimension when traversing an array. The byte offset of element (i[0], i[1], ..., i[n]) in an array a is: offset = sum(np.array(i) * a.strides) A more detailed explanation of strides can be found in the ?ndarray.rst? file in the NumPy reference guide. See also numpy.lib.stride_tricks.as_strided Notes Imagine an array of 32-bit integers (each 4 bytes): x = np.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]], dtype=np.int32) This array is

matrix.std()

matrix.std(axis=None, dtype=None, out=None, ddof=0) [source] Return the standard deviation of the array elements along the given axis. Refer to numpy.std for full documentation. See also numpy.std Notes This is the same as ndarray.std, except that where an ndarray would be returned, a matrix object is returned instead. Examples >>> x = np.matrix(np.arange(12).reshape((3, 4))) >>> x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>>

matrix.squeeze()

matrix.squeeze(axis=None) [source] Return a possibly reshaped matrix. Refer to numpy.squeeze for more documentation. Parameters: axis : None or int or tuple of ints, optional 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 : matrix The matrix, but as a (1, N) matrix if it had shape (N, 1). See also numpy.squeeze related function Notes If m has a single column then th

matrix.sort()

matrix.sort(axis=-1, kind='quicksort', order=None) Sort an array, in-place. Parameters: axis : int, optional Axis along which to sort. Default is -1, which means sort along the last axis. kind : {?quicksort?, ?mergesort?, ?heapsort?}, optional Sorting algorithm. Default is ?quicksort?. order : str or list of str, optional When a is an array with fields defined, this argument specifies which fields to compare first, second, etc. A single field can be specified as a string, and not all

matrix.size

matrix.size Number of elements in the array. Equivalent to np.prod(a.shape), i.e., the product of the array?s dimensions. Examples >>> x = np.zeros((3, 5, 2), dtype=np.complex128) >>> x.size 30 >>> np.prod(x.shape) 30

matrix.shape

matrix.shape Tuple of array dimensions. Notes May be used to ?reshape? the array, as long as this would not require a change in the total number of elements Examples >>> x = np.array([1, 2, 3, 4]) >>> x.shape (4,) >>> y = np.zeros((2, 3, 4)) >>> y.shape (2, 3, 4) >>> y.shape = (3, 8) >>> y array([[ 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0., 0., 0.]]) &g

matrix.setflags()

matrix.setflags(write=None, align=None, uic=None) Set array flags WRITEABLE, ALIGNED, and UPDATEIFCOPY, respectively. These Boolean-valued flags affect how numpy interprets the memory area used by a (see Notes below). The ALIGNED flag can only be set to True if the data is actually aligned according to the type. The UPDATEIFCOPY flag can never be set to True. The flag WRITEABLE can only be set to True if the array owns its own memory, or the ultimate owner of the memory exposes a writeable

matrix.setfield()

matrix.setfield(val, dtype, offset=0) Put a value into a specified place in a field defined by a data-type. Place val into a?s field defined by dtype and beginning offset bytes into the field. Parameters: val : object Value to be placed in field. dtype : dtype object Data-type of the field in which to place val. offset : int, optional The number of bytes into the field at which to place val. Returns: None See also getfield Examples >>> x = np.eye(3) >>> x.getfi

matrix.searchsorted()

matrix.searchsorted(v, side='left', sorter=None) Find indices where elements of v should be inserted in a to maintain order. For full documentation, see numpy.searchsorted See also numpy.searchsorted equivalent function

matrix.round()

matrix.round(decimals=0, out=None) Return a with each element rounded to the given number of decimals. Refer to numpy.around for full documentation. See also numpy.around equivalent function