Re: Numpy, adding a row to a matrix

2008-06-09 Thread sapsi
Hello, Thank you. Yes, I will post to the numpy mailing list in future. Regards Saptarshi On Jun 9, 4:04 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > sapsi wrote: > > Hello, > > I have a numpy array (2 rows 3 colums) > > > import numpy > > a=numpy.array(  [ [1,2,3] , [3,3,1] ]) > > > I wish to ad

Re: Numpy, adding a row to a matrix

2008-06-09 Thread Robert Kern
sapsi wrote: Hello, I have a numpy array (2 rows 3 colums) import numpy a=numpy.array( [ [1,2,3] , [3,3,1] ]) I wish to add a row, this is how i do it s=a.shape numpy.resize(a,s[0]+1,s[1]) a[s[0]]=new row vector. Q: Is this a costly operation? It can be if you have large arrays. What hap