将缺少日期的日期时间列表转换为错过的签到列表和mot错过的列表?

所以我有日期时间的有序列表

T = [t1,t2...tn]

With the expectation that on any given day, there ought to be two checkins or more, but the data is unreliable. Days could be missing or there could only be one data point per day. Furthermore, if the only timestamp for the first day occurs after midday, that's okay. It's also okay if the only timestamp for the last day occurs before midday. What I need to do is convert a given list of timestamps into two lists: times_had, times_missed Such that each of them contains the relative ordering of whatever timestamp they're tracking.

例如:

T = [(01/01 11:30), (01/01 23:30), (01/02 23:50), (01/03 11:00)]
Times_had = [1,2,4,5]
Times_missing = [3]

#And

T = [(01/01 12:30), (01/01 23:30), (01/01 23:45), (01/02 23:50), (01/04 15:30)]
Times_had = [1,2,3,5,9]
Times_missed = [4,6,7,8]

我有一个几乎可以运行的程序,但是它至少需要3个不同的嵌套if-else检查,即使这样也不能完全正常工作。