pasting numpy array into bigger array

TG girodt at gmail.com
Wed Jul 26 05:59:45 EDT 2006


hi.

let's say I have :

from numpy import *
x = identity(5)
y = zeros((7,7))

I want to paste x into y, starting at coordinates (1,1) in order to
change y to something like this :

0 0 0 0 0 0 0
0 1 0 0 0 0 0
0 0 1 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 1 0 0
0 0 0 0 0 1 0
0 0 0 0 0 0 0

how would you do that ?




More information about the Python-list mailing list