I have table df which contains logged in and logged out time of users
| Login time | Logout time |
|---|---|
| 2022-08-01 11:30:00 | 2022-08-01 11:50:00 |
| 2022-08-01 11:35:00 | 2022-08-01 11:55:00 |
| 2022-08-01 11:35:00 | 2022-08-01 11:57:00 |
I have another table df2 which contains datetimes when jobs are created
| created time |
|---|
| 2022-08-01 11:45:00 |
| 2022-08-01 11:51:00 |
| 2022-08-01 11:56:00 |
| 2022-08-01 11:57:00 |
| 2022-08-01 12:00:00 |
I am struggling to create a result df and would appreciate any help on how to create the resulting dataframe result_df
| created time | Online users | Offline users |
|---|---|---|
| 2022-08-01 11:45:00 | 3 | 0 |
| 2022-08-01 11:51:00 | 2 | 1 |
| 2022-08-01 11:56:00 | 1 | 2 |
| 2022-08-01 11:57:00 | 0 | 3 |
| 2022-08-01 12:00:00 | 0 | 3 |