From 406939eaaa28f946ca322d9248aa4a30e331ec0e Mon Sep 17 00:00:00 2001 From: juanboy <2980526980@qq.com> Date: Thu, 4 Jul 2024 15:46:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=88=AC=E8=99=AB=E7=BB=93=E6=9D=9F=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=89=93=E6=A0=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/yuqingpredict.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/utils/yuqingpredict.py b/utils/yuqingpredict.py index 8062d75..cada70e 100644 --- a/utils/yuqingpredict.py +++ b/utils/yuqingpredict.py @@ -69,13 +69,11 @@ def getTopicCreatedAtandpredictData(topic):# 统计特定话题的评论在每 else: createdAt[i[1]] = 1 createdAt = {k: createdAt[k] for k in sorted(createdAt, key=lambda date: datetime.datetime.strptime(date, "%Y-%m-%d"))} - print(createdAt) createdAt.update(predict_future_values(createdAt)) - print(createdAt) sorted_data = {k: createdAt[k] for k in sorted(createdAt, key=lambda date: datetime.datetime.strptime(date, "%Y-%m-%d"))} - return topic,sorted_data - # return topic,list(createdAt.keys()),list(createdAt.values()) - # return topic, createdAt.items() + result_list = [0] * (len(sorted_data) - 5) + [1] * 5 + return topic,sorted_data,result_list + # return topic,list(createdAt.keys()),list(createdAt.values()),result_list def writeTopicsToCSV(topics, file_name): # 检查文件是否存在,如果存在则附加写入,否则新建一个