Commit 46e76ad5 authored by 赵威's avatar 赵威

add printer

parent 094cc51d
......@@ -11,7 +11,7 @@ from pyspark.sql import SparkSession
from tool import (get_jerry_test, get_tag3_user_log, send_email, write_user_portrait, write_user_portrait_by_event)
# [{'激光': 1.949194898204873}, {'手术': 1.949194898204873}, {'手术': 1.949194898204873}, {'手术': 1.949194898204873}]
# [{'激光': 1.949194898204873}, {'手术': 1.949194898204873}, {'手术': 1.949194898204873}, {'手术': 1.949194898204873, '植发际线': 7.1}]
# {'手术': 5.8475846946146195, '激光': 1.949194898204873}
def merge_values(list_of_dict):
d = dict(functools.reduce(operator.add, map(Counter, list_of_dict)))
......@@ -41,7 +41,9 @@ def merge_results_by_event(lst):
tmp[event_cn].append(d)
res = {}
for (k, v) in tmp.items():
res[k] = merge_values(v)
d2 = merge_values(v)
if d2:
res[k] = d2.keys()
return res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment