pandas转为字典格式 金融小白数据分析之路 2022-09-05 62 阅读1分钟 import pandas as pd df=pd.read_excel('文件路径') print(df.set_index(['词'])['频率'].to_dict()) #输出效果{'blackout': 176, 'light': 103}