Note that you want scipy >= 0.7.0. 0.6 has a very bug and inconsistent
implementation of sparse matrices.
We describe the details of the compressed sparse matrix types.
``scipy.sparse.csc_matrix``
should be used if the columns are sparse.
``scipy.sparse.csr_matrix``
should be used if the rows are sparse.
``scipy.sparse.lil_matrix``
is faster if we are modifying the array. After initial inserts,
we can then convert to the appropriate sparse matrix format.
There are four member variables that comprise a compressed matrix ``sp``:
``sp.shape``
gives the shape of the matrix.
``sp.data``
gives the values of the non-zero entries. For CSC, these should
be in order from (I think, not sure) reading down in columns,
starting at the leftmost column until we reach the rightmost
column.
``sp.indices``
gives the location of the non-zero entry. For CSC, this is the
row location.
``sp.indptr``
gives the other location of the non-zero entry. For CSC, there are
as many values of indptr as there are columns + 1 in the matrix.
``sp.indptr[k] = x`` and ``indptr[k+1] = y`` means that column
k contains sp.data[x:y], i.e. the xth through the y-1th non-zero values.
See the example below for details.
.. code-block:: python
>>> import scipy.sparse
>>> sp = scipy.sparse.csc_matrix((5, 10))
>>> sp[4, 0] = 20
/u/lisa/local/byhost/test_maggie46.iro.umontreal.ca/lib64/python2.5/site-packages/scipy/sparse/compressed.py:494: SparseEfficiencyWarning: changing the sparsity structure of a csc_matrix is expensive. lil_matrix is more efficient.