# requires: list of datetime objects mod_times from collections import Counter import math def titanic_index_entropy(mod_times, bin_seconds=60): bins = [(int(dt.timestamp()) // bin_seconds) for dt in mod_times] cnt = Counter(bins) probs = [v/len(mod_times) for v in cnt.values()] H = -sum(p*math.log2(p) for p in probs) Hmax = math.log2(len(cnt)) if len(cnt)>0 else 1 return (1 - H / Hmax) * 100 if Hmax>0 else 0
In summary, my response should cover:
: Some directories are intentionally left open by security researchers or authorities to track users who download copyrighted or illegal material. # requires: list of datetime objects mod_times from