标签:test 表情 value data scalar -- 报错 values must
在将dict转为DataFrame时会报错:If using all scalar values, you must pass an index
例如:
summary = pd.DataFrame({key:value for key,value in test.items()if key in index}) #查看汇总表情况
添加参数:index = [0]
summary = pd.DataFrame({key:value for key,value in test.items()if key in index},index = [0]) #查看汇总表情况
python -- 解决If using all scalar values, you must pass an index问题
标签:test 表情 value data scalar -- 报错 values must
原文地址:https://www.cnblogs.com/nxf-rabbit75/p/10163735.html