import pandas as pd f2=pd.DataFrame() word=list(dict_dz.keys()) #保存一个列词 word_frequency=list(dict_dz.values()) #保存一列词频 #dict_dz=dict(zip(word,word_frequency)) #俩个列表变回字典形式 f2['word']=word f2['word_frequency']=word_frequency f2.to_excel("词频.xlsx")