我需要从一系列条目中得到月末余额
样本数据:
date contrib totalShrs
0 2009-04-23 5220.00 10000.000
1 2009-04-24 10210.00 20000.000
2 2009-04-27 16710.00 30000.000
3 2009-04-30 22610.00 40000.000
4 2009-05-05 28909.00 50000.000
5 2009-05-20 38409.00 60000.000
6 2009-05-28 46508.00 70000.000
7 2009-05-29 56308.00 80000.000
8 2009-06-01 66108.00 90000.000
9 2009-06-02 78108.00 100000.000
10 2009-06-12 86606.00 110000.000
11 2009-08-03 95606.00 120000.000
输出如下所示:
2009-04-30 40000
2009-05-31 80000
2009-06-30 110000
2009-07-31 110000
2009-08-31 120000
有简单的方法吗
我不明白我怎么能和一个团员这样的人在一起
或者我需要做一些像iTErrors这样的事情,找到所有每月的条目,按日期排序,然后选择最后一个条目
谢谢
使用^{} 和^{} ,用} 向前填充缺失的值:
ffill
和^{下面给出了所需的信息,即月末值,但格式与您要求的不完全相同:
输出:
相关问题 更多 >
编程相关推荐