Le vendredi 04 avril 2008 à 00:28 -0700, wilson a écrit :
#of shape (1,6)
eval=array([[3.,3.2,1.,1.1,5.,0.5]])
eval.shape=(-1,)
please not the correction..i need to multiply first row of egimgs with
3.0 ,second row with 3.2,last(sixth) row with 0.5 ..For that
purpose i made the
hello
i have two arrays
#of shape (1,6)
eval=array([[3.,3.2,1.,1.1,5.,0.5]])
#of shape (6,8)
egimgs=array([
[3.,2.,1.,4.,5.,1.5,2.5,1.1],
[1.1,3.,.5,.2,.1,4.3,3.2,1.2],
[4.,3.,2.,6.,1.,4.,5.1,2.4],
#of shape (1,6)
eval=array([[3.,3.2,1.,1.1,5.,0.5]])
eval.shape=(-1,)
please not the correction..i need to multiply first row of egimgs with
3.0 ,second row with 3.2,last(sixth) row with 0.5 ..For that
purpose i made the above into a 1 dimensional array.
A for loop seems inefficient in
result = (egimgs.T * eval.flat).T
or, in place
E = egimgs.T
E *= eval.flat
(egimgs would updated)
Nadav.
-הודעה מקורית-
מאת: [EMAIL PROTECTED] בשם wilson
נשלח: ו 04-אפריל-08 08:58
אל: numpy-discussion@scipy.org
נושא: [Numpy-discussion] multiply array
hello
i have two arrays