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 Dataframe using Pandas. I've uploaded a csv.file.
When I type data.Country
and data.Year
, I get the 1st Column and the second one displayed. However when I type data.Number
, everytime it gives me this error:
AttributeError: 'DataFrame' object has no attribute 'Number'.
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'})