[SciPy-dev] A typo in the sparse.csc_matrix docstring

Constantine Khroulev c.khroulev at gmail.com
Wed Mar 14 03:49:09 EDT 2007


Hello all,

I'm trying to build a CSC sparse matrix, and it seems like there is a typo in
the following docstring:

---------- beginning of the docstring ----------
    Compressed sparse column matrix
    This can be instantiated in several ways:
      - csc_matrix(d)
        with a dense matrix d
    
      - csc_matrix(s)
        with another sparse matrix s (sugar for .tocsc())
    
      - csc_matrix((M, N), [nzmax, dtype])
        to construct a container, where (M, N) are dimensions and
        nzmax, dtype are optional, defaulting to nzmax=sparse.NZMAX
        and dtype='d'.
    
      - csc_matrix((data, ij), [(M, N), nzmax])
        where data, ij satisfy:
            a[ij[k, 0], ij[k, 1]] = data[k]
    
      - csc_matrix((data, row, ptr), [(M, N)])
        standard CSC representation
------------ end of the docstring --------------

According to the sparse.py itself, the line
"a[ij[k, 0], ij[k, 1]] = data[k]" should read "a[ij[0, k], ij[1, k]] = data[k]".

(Which I kind of like, because it makes porting things from MATLAB a little
easier -- no need to call zip()). :)

Thank you.

-- 
Constantine




More information about the SciPy-Dev mailing list