how to add two pandas series

0
s1 = pd.Series(['2', '4', '6', '8', '10'])
s2 = pd.Series(['1','3','5','7','9'])

s1+s2

0     21
1     43
2     65
3     87
4    109

As you observe what I get is a " concat " of the values, with their respective index and what I need is the sum of them THANKS TO WHO CAN HELP ME.

    
asked by rose dewitt 31.10.2018 в 23:44
source

1 answer

0

Try this:
a=[1,24,5,5]
b=[9,91,81,5]
Total =[ int(b[x]) + int(a[x]) for x in range(0,len(a)-1)]
Or you can use
Total =[ sum(int(x)) for x in zip(a,b)]

    
answered by 01.11.2018 / 00:56
source