Most functions in numpy return ndarray by default.
Use numpy.asmatrix() if you want a matrix.
>>> from numpy import matlib, asmatrix
>>> m = matlib.reshape([1,2],(2,1))
>>> type(m)
>>> type( asmatrix(m) )
--
Pengkui
On Wed, Sep 28, 2011 at 22:09, Alan G Isaac wrote:
> Is this the intended b
On Sun, Sep 11, 2011 at 13:23, Pauli Virtanen wrote:
> Sun, 11 Sep 2011 03:03:26 -0500, Pengkui Luo wrote:
> [clip]
> > However, converting a large sparse matrix to dense would easily eat up
> > the memory. Is there a way for np.sign (as well as other ufunc) to take
>
It seems that numpy universal functions only apply to ndarray (or dense
matrix). Is there a way to apply them to scipy sparse matrices also?
For example, suppose S is an large sparse matrix (lil_matrix format,
dtype=np.float). I want to get another sparse matrix B (of the same shape)
that represen