Python 如何在Pandas中的预算表中添加具有增长率的列?

Python 如何在Pandas中的预算表中添加具有增长率的列?,python,pandas,jupyter-notebook,Python,Pandas,Jupyter Notebook,我想知道如何在熊猫的以下数据中添加每年的增长率 Date Total Managed Expenditure 0 2001 503.2 1 2002 529.9 2 2003 559.8 3 2004 593.2 4 2005 629.5 5 2006

我想知道如何在熊猫的以下数据中添加每年的增长率

    Date  Total Managed Expenditure
0   2001                      503.2
1   2002                      529.9
2   2003                      559.8
3   2004                      593.2
4   2005                      629.5
5   2006                      652.1
6   2007                      664.3
7   2008                      688.2
8   2009                      732.0
9   2010                      759.2
10  2011                      769.2
11  2012                      759.8
12  2013                      760.6
13  2014                      753.3
14  2015                      757.6
15  2016                      753.9
使用系列:

要重新分配,请执行以下操作:

df['Growth Rate'] = df['Total Managed Expenditure'].pct_change()

您知道如何将其设置为小数点后两位吗?您可以在末尾添加
。第二轮
df[“管理支出总额]。pct_change()。第二轮
df['Growth Rate'] = df['Total Managed Expenditure'].pct_change()