I am trying to write Pandas code to calculate accounting depreciations. The math is very simple:
depreciation(t)=depr_rate * [cumsum(investments(t)) - cumsum(deprecia