Finding datetime difference between lists in python
Clash Royale CLAN TAG #URR8PPP Finding datetime difference between lists in python I'm new to python. I've looked at previous threads like this and this. I have a Series of dates and times that created this way: tp1= for f in files: ### files is the variable that has all the files I need to read in this loop t=f[-19:-5] ### these characters in the filename correspond to the date and time tp1.append(datetime.strptime(t,"%Y%m%d%H%M%S")) time_p1_cr=pd.to_datetime(pd.Series(tp1), format='%Y-%m-%d %H:%M:%S') tp1 looks like: [datetime.datetime(2018, 8, 1, 16, 6, 39), datetime.datetime(2018, 8, 2, 17, 16, 37), datetime.datetime(2018, 8, 3, 10, 53, 46), datetime.datetime(2018, 8, 3, 17, 14, 39), datetime.datetime(2018, 8, 4, 11, 21, 36), datetime.datetime(2018, 8, 4, 17, 27, 54), and so on. time_p1_cr looks like : 0 2018-08-01 16:06:39 1 2018-08-02 17:16:37 2 2018-08-03 10:53:46 3 2018-08-03 17:14:39 and so on. I need to find the successive differences between ...