自定义创建“dataframe”时,采用“列”方向键入新数据记录报错。
“数据记录”在dataframe中的结构描述失误。以下,流程拆分原理。
2.1 数据结构
正确示范
错误示范
三、处理思路
【思路】核对,原来处于相同行的记录,在index参数设置中是否设置错误
# 源码
test_series = {"a":pd.Series(["c11", "c21"], index=[3, 4]),
"b":pd.Series(["c12", "c22"], index=[3, 4]),
"c":pd.Series(["c13", "c23"], index=[3, 4])
}
pd.Dataframe(test_series)



