[Numpy-discussion] Expansion of Matrix

Reidar Strand Hagen Reidar.Strand.Hagen at idi.ntnu.no
Tue May 10 12:35:19 EDT 2005


Hi

Sorry if this is an obvious question, but I'm getting close to loosing 
sleep over it now :)

If I have a matrix:

1 2 3
4 5 6
7 8 9

is there a nice general way to expand the matrix to:

1 0 2 3
4 0 5 6
0 0 0 0
7 0 8 9

The actual dataset in question has dimensions  128 * 128 * 128; so big 
enough for me to worry quite abit about duplication and general speed.

vennlig hilsen / regards
Reidar Strand Hagen




More information about the NumPy-Discussion mailing list