1 TypeError: Index(...) must be called with a collection of some kind, ' ' was passed
columns : Index or array-like
Column labels to use for resulting frame. Will default to np.arange(n) if no column labels are provided
如果你的数据只有一列,对于column,需要加个中括号
df = pd.DataFrame(data,columns=['result'])
本文汇总了在使用Pandas时遇到的一个典型错误:'TypeError: Index(...) must be called with a collection of some kind, ' ' was passed'。错误发生的原因在于提供给DataFrame的列标签不是有效的集合类型。解决方案是在只有一列数据时,确保为'columns'参数传递一个包含列名的列表。"
43085901,3332691,C# 控制系统音量和麦克风大小的方法,"['C#编程', '音频处理', '系统设置']
522

被折叠的 条评论
为什么被折叠?



