![](https://secure.gravatar.com/avatar/612395b66b3e7959997007b342b3688a.jpg?s=120&d=mm&r=g)
On Wed, 19 Nov 2008 01:39:34 -0600 "Robert Kern" <robert.kern@gmail.com> wrote:
On Wed, Nov 19, 2008 at 01:32, Nils Wagner <nwagner@iam.uni-stuttgart.de> wrote:
Hi all,
How can I insert a row/column in an existing array ?
You can't.
How about that ?
A = ones((10,5)) A array([[ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.], [ 1., 1., 1., 1., 1.]]) A=insert(A,[1],20,axis=1) A array([[ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.], [ 1., 20., 1., 1., 1., 1.]]) A[:,1] = random.rand(10)
Nils