I want to select the particular client sessions based on a date. I am having a data frame with all sessions of clients and I want to make two new df's: one with the first session of each client, and one with the second session of each client. The sessions are randomly generated numbers, just like the client id's (for example I adjusted them to 1, 2, and 3).
My data looks like:
Client id Session id Date
1 95738 13-03-2019
1 61718 18-03-2019
1 81289 19-03-2019
1 89239 20-03-2019
2 91298 13-02-2019
2 12794 15-02-2019
2 10083 16-02-2019
3 90138 03-02-2019
3 23128 06-02-2019
I want to have the output for the df with only the first session like:
Client id Session id Date
1 95738 13-03-2019
2 91298 13-02-2019
3 90138 03-02-2019
And for the df with the second sessions like:
Client id Session id Date
1 61718 18-03-2019
2 12794 15-02-2019
3 23128 06-02-2019