Data-frame Object has no Attribute

前端 未结 5 1101
我寻月下人不归
我寻月下人不归 2020-12-13 18:26

I know that this kind of question was asked before and I\'ve checked all the answers and I have tried several times to find a solution but in vain. In fact I call a Datafra

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-13 19:18

    Check your DataFrame with data.columns

    It should print something like this

    Index([u'regiment', u'company',  u'name',u'postTestScore'], dtype='object')
    

    Check for hidden white spaces..Then you can rename with

    data = data.rename(columns={'Number ': 'Number'})
    

提交回复
热议问题