How can I calculate the time difference between a client's actions?
I want to calculate all the elapsed time of the users until it passes to the next user. example .... from user 1 to two it was 2 days 4 hours, 5 seconds.
This is the dataframe:
df = pd.DataFrame({'usuario': [1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2],
'Fecha': ['1990-01-02','1990-01-03','1990-01-04','1990-01-05','1990-01-08',\
'1990-01-09','1990-01-10','1990-01-11','1990-01-12' ,'1990-01-15',\
'1990-01-16', '1990-01-17', '1990-01-18','1990-01-19','1990-01-22',\
'1990-01-23 ', '1990-01-24', '1990-01-25','1990-01-26','1990-01-29'],
'Hora': ['10:10:00','10:11:00','10:12:00','10:13:00','10:10:00',\
'10:10:00','10:17:00','10:14:00','11:14:00','12:14:00',\
'10:10:00', '10:20:00', '14:22:00','15:22:00','16:22:00',\
'10:10:00', '00:00:00', '00:00:00','00:00:00','00:00:00']})
Each user has an event, purchase, visit product, etc. How can I add these events per user? For example, the events are to enter the page, see the product, is in the main page, is in the purchase page, product purchase. Obvious that each of these events in a different row and I want to tell if the user made several times an action ... for example user 1, entered 2 times to the main page, entered 2 times to product, bought 1 time. (do not have it separated)