1 TypeError: Index(...) must be called with a collection of some kind, ' ' was passed columns

今天犯了这个错误 ,查到的解决方法如下

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'])
--------------------- 
作者:飞奔的帅帅 
来源:CSDN 
原文:https://blog.csdn.net/ustbbsy/article/details/80743097 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/zhuoyuezai/article/details/84072393
今日推荐