Hi guys, I'm a Clinical/Business Data Analyst for a large healthcare organization. I have recently started messing with Python to help me clean up some data, but I'm stuck. I have a report that has some start and end dates. Due to the nature of the end users, I have duplicate records because they entered some data on fields as start and ended the record on different fields with end date. I need to merge the records that have a start date but are missing and end date with the corresponding record missing a start date but have an end date. I migrated the data from Excel to SQLite using python so I can manipulate the records in either SQL or in Excel before exporting to SQLite. Here's a visual:
--------------------------------------------
ID |START |END |
1 |2019-11-6 17:30:00 |(NULL) |
2 |2019-10-5 19:31:06 |2019-10-5 19:47:33 |
3 |2019-09-6 11:21:06 |2019-09-6 12:47:39 |
1 |2019-10-6 01:21:06 |2019-10-6 02:39:32 |
1 |(NULL) |2019-11-6 17:39:00 |
--------------------------------------------
--------------------------------------------
ID |START |END |
1 |2019-11-6 17:30:00 |2019-11-6 17:39:00 |
2 |2019-10-5 19:31:06 |2019-10-5 19:47:33 |
3 |2019-09-6 11:21:06 |2019-09-6 12:47:39 |
1 |2019-10-6 01:21:06 |2019-10-6 02:39:32 |
--------------------------------------------
--------------------------------------------
ID |START |END |
1 |2019-11-6 17:30:00 |(NULL) |
2 |2019-10-5 19:31:06 |2019-10-5 19:47:33 |
3 |2019-09-6 11:21:06 |2019-09-6 12:47:39 |
1 |2019-10-6 01:21:06 |2019-10-6 02:39:32 |
1 |(NULL) |2019-11-6 17:39:00 |
--------------------------------------------
--------------------------------------------
ID |START |END |
1 |2019-11-6 17:30:00 |2019-11-6 17:39:00 |
2 |2019-10-5 19:31:06 |2019-10-5 19:47:33 |
3 |2019-09-6 11:21:06 |2019-09-6 12:47:39 |
1 |2019-10-6 01:21:06 |2019-10-6 02:39:32 |
--------------------------------------------