[SciPy-user] dimension mismatch error

Dinesh B Vadhia dineshbvadhia@hotmail....
Sun Jan 11 06:15:03 CST 2009


I want to do a vector-matrix multiplication as follows:

z = y * A

... where y is a (1 x J) vector, A is a (I x J) Scipy (csr) Sparse matrix, and the resulting z a (1 x J) vector.

The calculation results in this dimension mismatch error:

Traceback (most recent call last):
  File " ... .py", line 260, in <module>
    ...
  File "C:\Python25\Lib\site-packages\scipy\sparse\base.py", line 350, in __rmul__
    return (self.transpose() * tr).transpose()
  File "C:\Python25\Lib\site-packages\scipy\sparse\base.py", line 299, in __mul__
    raise ValueError('dimension mismatch')
ValueError: dimension mismatch

Any ideas?

Dinesh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20090111/a71ef15a/attachment.html 


More information about the SciPy-user mailing list