我有一个包含 2010-2014 年邮政编码平均收入的数据框。我想要 2015-2017 年的数据,所以我正在寻找一种方法来根据每个邮政编码组在可用年份的年平均变化来推断这一点。
例如:
year zip income
2010 1111 5000
2011 1111 5500
2012 1111 6000
2013 1111 6500
2014 1111 7000
2010 2222 5000
2011 2222 6000
2012 2222 7000
2013 2222 8000
2014 2222 9000
应该(大致)有:
year zip income
2010 1111 5000
2011 1111 5500
2012 1111 6000
2013 1111 6500
2014 1111 7000
2015 1111 7614
2016 1111 8282
2017 1111 9009
2010 2222 5000
2011 2222 6000
2012 2222 7000
2013 2222 8000
2014 2222 9000
2015 2222 10424
2016 2222 12074
2017 2222 13986
基于邮政编码 1111 的平均增长率为 8.78%,邮政编码 2222 的平均增长率为 15.83%。