Please can you help me solve this problem:
I am trying to add two rows in my dataframe and save the result in a new column but it has not worked with the code with which I am trying to solve it.
These are the data:
The idea would be to add the first two data (rows 0 and 1) of the column Balance_total and save them in a new column with the results, then add the two data that follow (rows 2 and 3) and save the result in the new column and so on, adding two by two.
So far I have been trying with various codes not getting the result:
dftotals['variation']=dftotals.iloc[:,[0,1]].sum(axis = 0)
Beforehand thank you very much