I'm doing a research on land consumption and demographic growth. I have a dataframe with a chronological sequence of population listed for a period of years.
import pandas as pd
df = pd.DataFrame({'year': [2014, 2015, 2016, 2017, 2018], 'population': [66354, 63322,83381, 91563, 93709]})
In other vain I had the number of buildings constructed grouped by year.
df2 = pd.DataFrame({'year': [2014, 2015, 2016, 2017, 2018], 'numberOfBu': [1348, 900, 1137, 865, 235]})
To make a comparison with the sequence between buildings and population I should make an incremental adition year by year for the buildings -as it's done with the values of population. So I must add the first value with the second, the result of both with the third and so on.
Is there a solution with pandas?