[SciPy-user] Re: [Numpy-discussion] Removing rows and columns of a matrix

Nils Wagner nwagner at mecha.uni-stuttgart.de
Mon Jul 28 11:19:30 EDT 2003


Konrad Hinsen schrieb:
> 
> On Monday 28 July 2003 16:26, Nils Wagner wrote:
> > Konrad Hinsen schrieb:
> > > >  How can I delete a column/row from a matrix.
> > >
> > > As an in-place operation, not at all. To get a copy of an array with some
> > > columns/rows removed, use Numeric.take.
> >
> > The in-place operation of matlab is a nice feature. Is it thinkable to
> > have this
> > in scipy or numarray at a later date ?
> 
> I'd say that the obvious way to implement it is as
> 
>   del a[2:3,:]
> 
> That can certainly be done, but someone has to do it.
> 
> Personally, I am not convinced that it is very useful. The consequences of an
> in-place change can be disastrous when many references point to that array.
> But then, we have other in-place operations which sometimes are handy, so my
> usefulness estimation may be wrong.
> 
> Konrad.

In my opinion, this operation is quite useful. For example a finite
element model
where we have to impose several homogeneous boundary conditions. This
can be done 
by deleting columns and associated rows.

Nils

In any case I am interested in a reliable workaround for this feature.

A small example would be appreciated.
Thanks in advance.



> --
> -------------------------------------------------------------------------------
> Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
> Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
> Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
> 45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
> France                                   | Nederlands/Francais
> -------------------------------------------------------------------------------
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion




More information about the SciPy-User mailing list