From 8127ddcea5877b403ae12feacd2e51733950555a Mon Sep 17 00:00:00 2001 From: YAKUBU ABDULAI Date: Tue, 2 May 2023 15:14:05 +0800 Subject: [PATCH] Update 'app/pickle_idea2.py' Update comment --- app/pickle_idea2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pickle_idea2.py b/app/pickle_idea2.py index 0da55bc..a4f17a4 100644 --- a/app/pickle_idea2.py +++ b/app/pickle_idea2.py @@ -68,7 +68,7 @@ def save_frequency_to_pickle(d, pickle_fname): d2 = {} for k in d: if not k in exclusion_lst and not k.isnumeric() and not len(k) < 2: - d2[k] = list(sorted(d[k])) # 原先这里是d2[k] = list(sorted(set(d[k]))) + d2[k] = list(sorted(d[k])) # This code sorts the values of the dictionary 'd' associated with the key 'k' and assigns the resulting sorted list to the key 'k' in the dictionary 'd2'. However, it does not remove duplicates from the original list, which means that it keeps track of all counts even when the same value is clicked multiple times in a row. pickle.dump(d2, f) f.close()