Browse Source

word_set.remove('') ,之前需要判断是否存在该key

liyuyi@c-top.com.cn 3 years ago
parent
commit
d0a6162725
1 changed files with 2 additions and 1 deletions
  1. 2 1
      time_task/get_material_and_script_by_query_word.py

+ 2 - 1
time_task/get_material_and_script_by_query_word.py

@@ -38,7 +38,8 @@ def get_material_and_script(start_time=""):
     query_word_set = set(df['query_word'].values)
     recommended_word_set = set(df['recommended_word'].values)
     word_set = query_word_set.union(recommended_word_set)
-    word_set.remove('')
+    if '' in word_set:
+        word_set.remove('')
     query_word_time = 3
     for query_word in word_set:
         for source_code, value in source_name_map.items():