I recently downloaded my League of Legends Data. I have the following DF
df = pd.DataFrame.from_dict({'DateTime': {
0: 156102273400,
1: 156101627200,
2: 156092208200,
3: 1559897767000,
4: 1559890046000,
5: 1559889968000},
'EventType': {
0: 'LOGOUT_USER',
1: 'LOGIN',
2: 'LOGOUT_USER',
3: 'LOGIN',
4: 'LOGIN',
5: 'LOGIN'}})
I get the following df:
>>>df
Index DateTime EventType
0 156102273400 LOGOUT_USER
1 156101627200 LOGIN
2 156092208200 LOGOUT_USER
3 1559897767000 LOGIN
4 1559890046000 LOGIN
5 1559889968000 LOGIN
I want to map one single LOGOUT_USER to the minimum LOGIN before the next LOGOUT_USER is encountered. From there I should be able to calculate the total time played.
Ideal output would look as follows:
>>>fixed_df
Index DateTime EventType
0 156102273400 LOGOUT_USER
1 156101627200 LOGIN
2 156092208200 LOGOUT_USER
3 1559889968000 LOGIN