I think I understand what you’re asking. You just want to have a new dataframe that calculates the time difference between the three different entries for each unique order id? So, I start by creating the dataframe: data = [ [11238,3943,201805030759165986,’新建订单’,20180503075916,’2018/5/3 07:59:16′,’2018/5/3 07:59:16′], [11239,3943,201805030759165986,’新建订单’,20180503082115,’2018/5/3 08:21:15′,’2018/5/3 08:21:15′], [11240,3943,201805030759165986,’新建订单’,20180503083204,’2018/5/3 08:32:04′,’2018/5/3 08:32:04′], [11241,3941,201805030856445991,’新建订单’,20180503085644,’2018/5/3 08:56:02′,’2018/5/3 08:56:44′], [11242,3941,201805022232081084,’初审成功’,20180503085802,’2018/5/3 08:58:02′,’2018/5/3 08:58:02′], … Read more