Commit 5c289b71 authored by 高雅喆's avatar 高雅喆

update Top question data with have exposure data

parent d6ceee4c
...@@ -28,7 +28,7 @@ def result2file(fpath): ...@@ -28,7 +28,7 @@ def result2file(fpath):
2.1 用户点击次数分布(第一列:用户点击次数;第二列:独立用户数量) 2.1 用户点击次数分布(第一列:用户点击次数;第二列:独立用户数量)
2.2 Top 100 diary (sorted by ctr) 2.2 Top 100 diary (sorted by ctr)
2.3 Top 100 Answer (sorted by ctr) 2.3 Top 100 Answer (sorted by ctr)
2.4 Top 100 Question (sorted by click times) 2.4 Top 100 Question (sorted by ctr)
......
...@@ -21,7 +21,7 @@ def tuple2dict(tuple_result): ...@@ -21,7 +21,7 @@ def tuple2dict(tuple_result):
def result2file(result_lst,fpath): def result2file(result_lst,fpath):
with open(fpath,'w') as f: with open(fpath,'w') as f:
tplt = "{0:\u3000<4}\t{1:\u3000<12}\t{2:\u3000^6}\t{3:\u3000^6}\t{4:\u3000<8}\t{5:\u3000^15}\n" tplt = "{0:\u3000<4}\t{1:\u3000<12}\t{2:\u3000^6}\t{3:\u3000^6}\t{4:\u3000<8}\t{5:\u3000^15}\n"
f.write("2.4 Top 100 Question(曝光表里cid类型没有question,因此下面的曝光数和点击率都为0)\n") f.write("2.4 Top 100 Question\n")
f.write("=================================================================\n") f.write("=================================================================\n")
f.write(tplt.format("平台","question_id","点击数","曝光数","点击率","question链接")) f.write(tplt.format("平台","question_id","点击数","曝光数","点击率","question链接"))
for i in result_lst: for i in result_lst:
......
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