![](https://secure.gravatar.com/avatar/4049498c84d4a7a8f5f5afa5b86c4d2b.jpg?s=120&d=mm&r=g)
19 Nov
2008
19 Nov
'08
10:53 a.m.
Robert Kern a écrit :
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. And numpy.insert?
Return a new array with values inserted along the given axis before the given indices If axis is None, then ravel the array first. The obj argument can be an integer, a slice, or a sequence of integers. Examples -------- >>> a = array([[1,2,3], ... [4,5,6], ... [7,8,9]]) >>> insert(a, [1,2], [[4],[5]], axis=0) array([[1, 2, 3], [4, 4, 4], [4, 5, 6], [5, 5, 5], [7, 8, 9]]) Cheers, -- Fred