I have two data series in form
A
0 1
1 2
2 3
B
3 1
4 2
5 3
From where I want
C = A + B
to be
C
0 2
1 4
2 6
I have tried A + B.reindex_like(A) but it doesn't work. Everything I've tried gives me NaN's. Any help?
You could use reset_index(drop=True), since A's index is default?
In [127]: A + B.reset_index(drop=True)
Out[127]:
0 2
1 4
2 6
dtype: int64
Or,
In [128]: pd.Series(A.values + B.values, index=A.index)
Out[128]:
0 2
1 4
2 6
dtype: int64
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With