我的目标是获取此交易数据并创建一个活动客户数据框,就像示例一样。
TransactionID TransactionDate CustomerID Amount
1 2012-09-04 1 20.96
2 2012-05-15 2 10.87
3 2014-05-23 2 2.21
4 2014-10-24 2 10.48
5 2012-10-13 2 3.94
ActiveCustomers
Origin 12 24 36 48 60 72
2010-01-01 – 2010-12-31 172 93 104 91 103 82
2011-01-01 – 2011-12-31 170 92 98 89 88
2012-01-01 – 2012-12-31 163 109 98 90
2013-01-01 – 2013-12-31 180 103 102
2014-01-01 – 2014-12-31 155 90
2015-01-01 – 2015-12-31 160