当我运行时,
nfl_frame.columns
然后,我有这个输出:
Index(['Rank ', 'Team ', 'Won ', 'Lost ', 'Tied* ', 'Pct. ', 'First Season ',
'Total Games ', 'Conference'],
dtype='object')
但是,当我写道:
nfl_frame.Rank
它显示以下错误:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-180-49fcdc59c710> in <module>()
----> 1 nfl_frame.Rank
C:\Anaconda3\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)
2148 return self[name]
2149 raise AttributeError("'%s' object has no attribute '%s'" %
-> 2150 (type(self).__name__, name))
2151
2152 def __setattr__(self, name, value):
AttributeError: 'DataFrame' object has no attribute 'Rank'
*我使用的是Python 3.4和Ipython笔记本。