ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> scipy-dev
scipy-dev
Re: [SciPy-dev] sparse matrix support status
by Ed Schofield other posts by this author
Nov 23 2005 5:27PM messages near this date
Re: [SciPy-dev] sparse matrix support status | Re: [SciPy-dev] sparse matrix support status
On 23/11/2005, at 7:26 PM, Jonathan Guyer wrote:

> 
>  Well, I guess I find the result of:
> 
> >>> B = scipy.sparse.dok_matrix((3,3))
> >>> a = scipy.ones((3,))
> >>> B.setdiag(a,0)
> >>> print B.todense()
>       [[ 1.  0.  0.]
>        [ 0.  1.  0.]
>        [ 0.  0.  1.]]
> >>> B.setdiag(a,1)
> >>> print B.todense()
>       [[ 1.  1.  0.  0.]
>        [ 0.  1.  1.  0.]
>        [ 0.  0.  1.  1.]]
> 
>  to be surprising.
> 
>  I was expecting
> 
>       [[ 1.  1.  0.]
>        [ 0.  1.  1.]
>        [ 0.  0.  1.]]
> 

I agree this is more useful behaviour.  I've changed this in SVN and  
added an explicit resize() method for dok_matrices.

Thanks again for the feedback.

-- Ed

_______________________________________________
Scipy-dev mailing list
Scipy-dev@[...].net
http://www.scipy.net/mailman/listinfo/scipy-dev
Thread:
Travis Oliphant
Robert Cimrman
Travis Oliphant
Robert Cimrman
Fernando Perez
Jonathan Guyer
Fernando Perez
Jonathan Guyer
Jonathan Guyer
Robert Cimrman
Jonathan Guyer
Ed Schofield
Jonathan Guyer
Ed Schofield
Travis Oliphant
Jonathan Guyer
Nils Wagner
Jonathan Guyer
Robert Cimrman
Robert Kern
Robert Cimrman
Travis Oliphant
Fernando Perez
Jonathan Guyer
Travis Oliphant
Nils Wagner
Jeff Whitaker
Nils Wagner

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved