我有一个1000x6的数据帧。如何添加另外两列:列[latest person],列[latest date]以显示姓氏和 行动日期/时间
输入:
Reviewer 3 Action Date / Time.2 Approver 1 Action Date / Time.3 Approver 2 Action Date / Time.4
3970 0 0 Pat McEntee 10.04.2018 - 11:01:55 0 0
3971 John Hunt 12.04.2018 - 17:07:54 Paul Monnington 24.04.2018 - 16:22:17 0 0
3974 0 0 Mike Smith 16.04.2018 - 09:30:06 0 0
3975 0 0 Peter McNamara 13.04.2018 - 16:15:27 Stephen Harrison 20.04.2018 - 11:32:39
3977 0 0 Ananth Sarathy 17.04.2018 - 17:37:03 0 0
3978 John Hunt 19.04.2018 - 09:08:12 Sandra Osteni 19.04.2018 - 09:12:38 Amanda Bardwell 01.05.2018 - 09:01:20
3979 John Hunt 19.04.2018 - 09:08:12 Sandra Osteni 19.04.2018 - 09:09:36 Amanda Bardwell 01.05.2018 - 09:02:08
3980 John Hunt 19.04.2018 - 09:08:12 Sandra Osteni 19.04.2018 - 09:13:01 Amanda Bardwell 01.05.2018 - 09:00:49
3981 John Hunt 17.04.2018 - 15:52:58 Sandra Osteni 19.04.2018 - 09:11:58 Amanda Bardwell 01.05.2018 - 09:00:17
3982 John Hunt 17.04.2018 - 15:52:01 Sandra Osteni 19.04.2018 - 09:11:22 Amanda Bardwell 01.05.2018 - 09:01:34
3984 0 0 Mike Smith 04.05.2018 - 14:51:58 0 0
...
4012 0 0 Trent Mason 23.04.2018 - 12:56:04 Mike Smith 23.04.2018 - 15:03:06
4013 0 0 Trent Mason 23.04.2018 - 12:57:26 Mike Smith 23.04.2018 - 15:14:41
4014 0 0 Trent Mason 23.04.2018 - 12:56:58 Mike Smith 23.04.2018 - 15:15:46
4015 0 0 Trent Mason 23.04.2018 - 12:56:45 Mike Smith 23.04.2018 - 15:05:52
4016 0 0 Trent Mason 23.04.2018 - 12:57:40 Mike Smith 23.04.2018 - 15:03:39
4017 0 0 Trent Mason 23.04.2018 - 12:55:14 Mike Smith 23.04.2018 - 15:04:52
4018 John Hunt 23.04.2018 - 10:29:59 Sandra Osteni 30.04.2018 - 13:09:01 Sandra Osteni 30.04.2018 - 13:09:19
4019 0 0 Trent Mason 23.04.2018 - 12:55:50 Mike Smith 23.04.2018 - 15:09:18
期望输出:
Latest person Latest date
Pat McEntee 10.04.2018 - 11:01:55
Paul Monnington 24.04.2018 - 16:22:17
Mike Smith 16.04.2018 - 09:30:06
Stephen Harrison 20.04.2018 - 11:32:39
Ananth Sarathy 17.04.2018 - 17:37:03
...
Sandra Osteni 30.04.2018 - 13:09:19
Mike Smith 23.04.2018 - 15:09:18
看起来您希望获得最右边的列对,如
Latest person/date
。为了快速实现这一点,在用NaN
替换0
之后,进行按列向前填充并获取新列的最右边的信息相关问题 更多 >
编程相关推荐