matrix.argsort()

matrix.argsort(axis=-1, kind='quicksort', order=None) Returns the indices that would sort this array. Refer to numpy.argsort for full documentation. See also numpy.argsort equivalent function

matrix.argpartition()

matrix.argpartition(kth, axis=-1, kind='introselect', order=None) Returns the indices that would partition this array. Refer to numpy.argpartition for full documentation. New in version 1.8.0. See also numpy.argpartition equivalent function

matrix.argmin()

matrix.argmin(axis=None, out=None) [source] Indexes of the minimum values along an axis. Return the indexes of the first occurrences of the minimum values along the specified axis. If axis is None, the index is for the flattened matrix. Parameters: See `numpy.argmin` for complete descriptions. See also numpy.argmin Notes This is the same as ndarray.argmin, but returns a matrix object where ndarray.argmin would return an ndarray. Examples >>> x = -np.matrix(np.arange(12).reshape((

matrix.argmax()

matrix.argmax(axis=None, out=None) [source] Indexes of the maximum values along an axis. Return the indexes of the first occurrences of the maximum values along the specified axis. If axis is None, the index is for the flattened matrix. Parameters: See `numpy.argmax` for complete descriptions See also numpy.argmax Notes This is the same as ndarray.argmax, but returns a matrix object where ndarray.argmax would return an ndarray. Examples >>> x = np.matrix(np.arange(12).reshape((3,

matrix.any()

matrix.any(axis=None, out=None) [source] Test whether any array element along a given axis evaluates to True. Refer to numpy.any for full documentation. Parameters: axis : int, optional Axis along which logical OR is performed out : ndarray, optional Output to existing array instead of creating new one, must have same shape as expected output Returns: any : bool, ndarray Returns a single bool if axis is None; otherwise, returns ndarray

matrix.all()

matrix.all(axis=None, out=None) [source] Test whether all matrix elements along a given axis evaluate to True. Parameters: See `numpy.all` for complete descriptions See also numpy.all Notes This is the same as ndarray.all, but it 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]]) >>> y = x[0]; y matrix([[0, 1, 2, 3]]) >>> (x == y) matrix([[ True, Tru

matrix.A1

matrix.A1 Return self as a flattened ndarray. Equivalent to np.asarray(x).ravel() Parameters: None Returns: ret : ndarray self, 1-D, as an ndarray 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.getA1() array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])

matrix.A

matrix.A Return self as an ndarray object. Equivalent to np.asarray(self). Parameters: None Returns: ret : ndarray self as an ndarray 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.getA() array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]])

Matrix library (numpy.matlib)

This module contains all functions in the numpy namespace, with the following replacement functions that return matrices instead of ndarrays. Functions that are also in the numpy namespace and return matrices mat(data[, dtype]) Interpret the input as a matrix. matrix Returns a matrix from an array-like object, or from a string of data. asmatrix(data[, dtype]) Interpret the input as a matrix. bmat(obj[, ldict, gdict]) Build a matrix object from a string, nested sequence, or array. Replacem

Mathematical functions with automatic domain (numpy.emath)

Note numpy.emath is a preferred alias for numpy.lib.scimath, available after numpy is imported. Wrapper functions to more user-friendly calling of certain math functions whose output data-type is different than the input data-type in certain domains of the input. For example, for functions like log with branch cuts, the versions in this module provide the mathematically valid answers in the complex plane: >>> import math >>> from numpy.lib import scimath >>> scimat