From c03630a5658b3c26dbbeb1286f455b209944ef87 Mon Sep 17 00:00:00 2001 From: py6qo2c5g <457171044@qq.com> Date: Wed, 18 Sep 2024 19:32:08 +0800 Subject: [PATCH] ADD file via upload --- 4.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 4.py diff --git a/4.py b/4.py new file mode 100644 index 0000000..ed50b16 --- /dev/null +++ b/4.py @@ -0,0 +1,8 @@ +import pandas as pd + + +def write_to_excel(count_dict): + data = {'关键词': list(count_dict.keys()), '数量': list(count_dict.values())} + df = pd.DataFrame(data) + df = df.sort_values(by='数量', ascending=False) + df.to_excel('danmaku_count.xlsx', index=False)