Reputation: 692
I have a data frame in which column A is the start time of an activity and column B is the finish time of that activity, and each row represents an activity (rows are arranged chronologically). I want to compute the difference in time between the end of one activity and the start of the next activity, i.e. df[i+1][A] - df[i][B].
Is there a Pandas function to do this (the only thing I can find is diff(), but that only appears to work on a single column).
Upvotes: 8
Views: 6433