Re: elementwise multiplication of 2 lists of numbers

2010-09-20 Thread Peter Otten
harryos wrote: > I have 2 lists of numbers,say > x=[2,4,3,1] > y=[5,9,10,6] > I need to create another list containing > z=[2*5, 4*9, 3*10, 1*6] ie =[10,36,30,6] > > I did not want to use numpy or any Array types.I tried to implement > this in python .I tried the following > > z=[] > for a,b in

Re: elementwise multiplication of 2 lists of numbers

2010-09-20 Thread Arnaud Delobelle
On Sep 20, 3:02 pm, harryos wrote: > hi > I have 2 lists of numbers,say > x=[2,4,3,1] > y=[5,9,10,6] > I need to create another list containing > z=[2*5, 4*9, 3*10, 1*6]  ie =[10,36,30,6] > > I did not want to use numpy or any Array types.I tried to implement > this in python .I tried the followin

Re: elementwise multiplication of 2 lists of numbers

2010-09-20 Thread harryos
On Sep 20, 7:28 pm, Bruno wrote: >> A list comp comes to mind, as well as using itertools.izip thanks Bruno,thanks Gary.. Should have thought of list comprehension.. Thanks for the pointer about izip harry -- http://mail.python.org/mailman/listinfo/python-list

Re: elementwise multiplication of 2 lists of numbers

2010-09-20 Thread Giacomo Boffi
harryos writes: > hi > I have 2 lists of numbers,say > x=[2,4,3,1] > y=[5,9,10,6] > I need to create another list containing > z=[2*5, 4*9, 3*10, 1*6] ie =[10,36,30,6] > > I did not want to use numpy or any Array types.I tried to implement > this in python .I tried the following > > z=[] > for a

Re: elementwise multiplication of 2 lists of numbers

2010-09-20 Thread Gary Herron
On 09/20/2010 07:02 AM, harryos wrote: hi I have 2 lists of numbers,say x=[2,4,3,1] y=[5,9,10,6] I need to create another list containing z=[2*5, 4*9, 3*10, 1*6] ie =[10,36,30,6] I did not want to use numpy or any Array types.I tried to implement this in python .I tried the following z=[] for

Re: elementwise multiplication of 2 lists of numbers

2010-09-20 Thread Bruno Desthuilliers
harryos a écrit : hi I have 2 lists of numbers,say x=[2,4,3,1] y=[5,9,10,6] I need to create another list containing z=[2*5, 4*9, 3*10, 1*6] ie =[10,36,30,6] I did not want to use numpy or any Array types.I tried to implement this in python .I tried the following z=[] for a,b in zip(x,y):

elementwise multiplication of 2 lists of numbers

2010-09-20 Thread harryos
hi I have 2 lists of numbers,say x=[2,4,3,1] y=[5,9,10,6] I need to create another list containing z=[2*5, 4*9, 3*10, 1*6] ie =[10,36,30,6] I did not want to use numpy or any Array types.I tried to implement this in python .I tried the following z=[] for a,b in zip(x,y): z.append(a*b) Th