[SciPy-user] New bmat constructor in SciPy

Pearu Peterson pearu at scipy.org
Tue Sep 23 15:09:56 EDT 2003


On Tue, 23 Sep 2003, Nils Wagner wrote:

> In this context it would be nice to have a tool to remove 
> rows and columns of a matrix 
> In Matlab: 
>  
> > > a=rand(4,4) 
>  
> a = 
>  
>     0.9501    0.8913    0.8214    0.9218 
>     0.2311    0.7621    0.4447    0.7382 
>     0.6068    0.4565    0.6154    0.1763 
>     0.4860    0.0185    0.7919    0.4057 
>  
> use 
>  
> > > a(:,2)=[] 

I wonder if in Python

>>> del a[:,2]

would be possible. Currently Numeric raises ValueError, numarray raises 
TypeError and 
  m=mat(a); del a[:,2]
gives AttributeError: __delitem__ not found.

Pearu




More information about the SciPy-User mailing list