matrix.reshape()

matrix.reshape(shape, order='C') Returns an array containing the same data with a new shape. Refer to numpy.reshape for full documentation. See also numpy.reshape equivalent function

matrix.resize()

matrix.resize(new_shape, refcheck=True) Change shape and size of array in-place. Parameters: new_shape : tuple of ints, or n ints Shape of resized array. refcheck : bool, optional If False, reference count will not be checked. Default is True. Returns: None Raises: ValueError If a does not own its own data or references or views to it exist, and the data memory must be changed. SystemError If the order keyword argument is specified. This behaviour is a bug in NumPy. See also

matrix.real

matrix.real The real part of the array. See also numpy.real equivalent function Examples >>> x = np.sqrt([1+0j, 0+1j]) >>> x.real array([ 1. , 0.70710678]) >>> x.real.dtype dtype('float64')

matrix.repeat()

matrix.repeat(repeats, axis=None) Repeat elements of an array. Refer to numpy.repeat for full documentation. See also numpy.repeat equivalent function

matrix.ravel()

matrix.ravel(order='C') [source] Return a flattened matrix. Refer to numpy.ravel for more documentation. Parameters: order : {?C?, ?F?, ?A?, ?K?}, optional The elements of m are read using this index order. ?C? means to index the elements in C-like order, with the last axis index changing fastest, back to the first axis index changing slowest. ?F? means to index the elements in Fortran-like index order, with the first index changing fastest, and the last index changing slowest. Note that

matrix.put()

matrix.put(indices, values, mode='raise') Set a.flat[n] = values[n] for all n in indices. Refer to numpy.put for full documentation. See also numpy.put equivalent function

matrix.ptp()

matrix.ptp(axis=None, out=None) [source] Peak-to-peak (maximum - minimum) value along the given axis. Refer to numpy.ptp for full documentation. See also numpy.ptp Notes Same as ndarray.ptp, except, where that would return an ndarray object, this returns a matrix object. Examples >>> x = np.matrix(np.arange(12).reshape((3,4))); x matrix([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]]) >>> x.ptp() 11 >>> x.ptp(0) matrix([[8, 8, 8, 8]]) >

matrix.partition()

matrix.partition(kth, axis=-1, kind='introselect', order=None) Rearranges the elements in the array in such a way that value of the element in kth position is in the position it would be in a sorted array. All elements smaller than the kth element are moved before this element and all equal or greater are moved behind it. The ordering of the elements in the two partitions is undefined. New in version 1.8.0. Parameters: kth : int or sequence of ints Element index to partition by. The kth

matrix.prod()

matrix.prod(axis=None, dtype=None, out=None) [source] Return the product of the array elements over the given axis. Refer to prod for full documentation. See also prod, ndarray.prod Notes Same as ndarray.prod, except, where that returns an ndarray, this returns a matrix object 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]]) >>> x.prod() 0 >>> x.prod(0) matrix([[

matrix.nonzero()

matrix.nonzero() Return the indices of the elements that are non-zero. Refer to numpy.nonzero for full documentation. See also numpy.nonzero equivalent function