I made some code that solve my problem, but it\'s to slow. Any others solutions?
for item in append_to_table2: counted = Counter(ls) if counted[item]