Re: Sum operation in numpy arrays

2013-05-02 Thread Steven D'Aprano
On Thu, 02 May 2013 02:10:11 -0700, Ana DionĂ­sio wrote: > Hello! I have several numpy arrays in my script and i want to add them. > For example: > > a=[1,2,3,4,5] > b=[1,1,1,1,1] > c=[1,0,1,0,1] These are not numpy arrays, they are lists of ints. Based on the error message you quote: TypeError

Re: Sum operation in numpy arrays

2013-05-02 Thread Jens Thoms Toerring
Ana DionĂ­sio wrote: > Hello! I have several numpy arrays in my script and i want to add them. For > example: > a=[1,2,3,4,5] > b=[1,1,1,1,1] > c=[1,0,1,0,1] > for i in range(5): > d[i]=a[i]+b[i]+c[i] > print d > [3,3,5,5,7] > I did it like that but I get an error: "TypeError: unsupported