解决问题
ValueError: If using all scalar values, you must pass an index
解决思路
值错误:如果使用所有标量值,则必须传递索引
解决方法
对字典格式的数据进行存储的时候,需要根据要求设定index。
注意dataframe格式数据直存的时候例外。
将
data = pd.DataFrame(data_dict)
改为
data = pd.DataFrame(data_dict,index=[0])
ValueError: If using all scalar values, you must pass an index
值错误:如果使用所有标量值,则必须传递索引
对字典格式的数据进行存储的时候,需要根据要求设定index。
注意dataframe格式数据直存的时候例外。
将
data = pd.DataFrame(data_dict)
改为
data = pd.DataFrame(data_dict,index=[0])