pandas转为字典格式

import pandas as pd
df=pd.read_excel('文件路径')
print(df.set_index(['词'])['频率'].to_dict())
#输出效果{'blackout': 176, 'light': 103}

猜你喜欢

转载自blog.csdn.net/weixin_45631815/article/details/109071512