SciPy 0.6.0 API Documentation Generated by Endo, 2007-10-17
Scipy 2D sparse matrix module.
Original code by Travis Oliphant. Modified and extended by Ed Schofield, Robert Cimrman, and Nathan Bell
ALLOCSIZE = 1000
MAXPRINT = 50
NZMAX = 100
issparse = isspmatrix
extract_diagonal(A) returns the main diagonal of A.
Function used to simplify argument processing. If 'dtype' is not specified (is None), returns a.dtype; otherwise returns a numpy.dtype object created from the specified dtype argument. If 'dtype' and 'a' are both None, construct a data type out of the 'default' parameter. Furthermore, 'dtype' must be in 'allowed' set.
Is x appropriate as an index into a sparse matrix? Returns True if it can be cast safely to a machine int.
Is x either a scalar, an array scalar, or a 0-dim array?
Is x a valid 2-tuple of dimensions?
Generate a lil_matrix with the given diagonals.
:Parameters:
diags : list of list of values e.g. [[1,2,3],[4,5]]
Values to be placed on each indicated diagonal.
offsets : list of ints
Diagonal offsets. This indicates the diagonal on which
the given values should be placed.
(r,c) : tuple of ints
Row and column dimensions of the output.
dtype : dtype
Output data-type.
Example:
-------
>>> lil_diags([[1,2,3],[4,5],[6]],[0,1,2],(3,3)).todense()
matrix([[ 1., 4., 6.],
[ 0., 2., 5.],
[ 0., 0., 3.]])
Generate a lil_matrix of dimensions (r,c) with the k-th diagonal set to 1.
| Parameters: |
|
|---|
Return a sparse matrix in CSC format given its diagonals.
B = spdiags(diags, offsets, M, N)
speye(n, m) returns a (n x m) matrix stored in CSC sparse matrix format, where the k-th diagonal is all ones, and everything else is zeros.
spidentity( n ) returns the identity matrix of shape (n, n) stored in CSC sparse matrix format.
| Local name | Refers to |
|---|---|
| amax | numpy.amax |
| amin | numpy.amin |
| arange | numpy.arange |
| array | numpy.array |
| asarray | numpy.asarray |
| asmatrix | numpy.asmatrix |
| bisect_left | bisect.bisect_left |
| clip | numpy.clip |
| conj | numpy.conj |
| cootocsc | scipy.sparse.sparsetools.cootocsc |
| cootocsr | scipy.sparse.sparsetools.cootocsr |
| copy | copy |
| cscmucsc | scipy.sparse.sparsetools.cscmucsc |
| cscmux | scipy.sparse.sparsetools.cscmux |
| csctocoo | scipy.sparse.sparsetools.csctocoo |
| csctocsr | scipy.sparse.sparsetools.csctocsr |
| csc_eldiv_csc | scipy.sparse.sparsetools.csc_eldiv_csc |
| csc_elmul_csc | scipy.sparse.sparsetools.csc_elmul_csc |
| csc_minus_csc | scipy.sparse.sparsetools.csc_minus_csc |
| csc_plus_csc | scipy.sparse.sparsetools.csc_plus_csc |
| csrmucsr | scipy.sparse.sparsetools.csrmucsr |
| csrmux | scipy.sparse.sparsetools.csrmux |
| csrtocoo | scipy.sparse.sparsetools.csrtocoo |
| csrtocsc | scipy.sparse.sparsetools.csrtocsc |
| csrtodense | scipy.sparse.sparsetools.csrtodense |
| csr_eldiv_csr | scipy.sparse.sparsetools.csr_eldiv_csr |
| csr_elmul_csr | scipy.sparse.sparsetools.csr_elmul_csr |
| csr_minus_csr | scipy.sparse.sparsetools.csr_minus_csr |
| csr_plus_csr | scipy.sparse.sparsetools.csr_plus_csr |
| densetocsr | scipy.sparse.sparsetools.densetocsr |
| empty | numpy.empty |
| greater | numpy.greater |
| imag | numpy.imag |
| intc | numpy.intc |
| isscalar | numpy.isscalar |
| itertools | itertools |
| less | numpy.less |
| matrix | numpy.matrix |
| ndarray | numpy.ndarray |
| numpy | numpy |
| ones | numpy.ones |
| operator | operator |
| prod | numpy.prod |
| rank | numpy.rank |
| real | numpy.real |
| searchsorted | numpy.searchsorted |
| shape | numpy.shape |
| sparsetools | SciPy.sparse.sparsetools |
| transpose | numpy.transpose |
| unravel_index | numpy.unravel_index |
| warnings | warnings |
| where | numpy.where |
| zeros | numpy.zeros |