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)