[Numpy-discussion] simple array help?

Janko Hauser jhauser at ifm.uni-kiel.de
Tue Oct 17 02:00:36 CDT 2000


Your mail is in some windows format :-)

reshape(resize(a,(1,15)),(5,3))

,should do it, perhaps reshape makes a new copy, to circumvent this you
can do it in two steps.

b=resize(a,(1,15))
b.shape = (5,3)

Another way is

ones((5,3), a.typecode())*a[:,NewAxis]

HTH,

__Janko




More information about the Numpy-discussion mailing list