我不知道这里有什么例外

时间:2015-10-11 06:28:00

标签: csv python-3.x numpy pandas

我正在尝试读取csv文件。使用以下命令:

sample = pd.read_csv("C:/kushal/DataMining/hillary/out.txt" ,header = 0, delimiter = "\t")

不幸的是,它给了我一些例外,我不知道是什么导致它。有没有人知道这个例外

    sample["ExtractedBodyText"][1]
Traceback (most recent call last):
  File "<pyshell#75>", line 1, in <module>
    hillary["ExtractedBodyText"][1]
  File "C:\Python34\lib\site-packages\pandas\core\frame.py", line 1914, in __getitem__
    return self._getitem_column(key)
  File "C:\Python34\lib\site-packages\pandas\core\frame.py", line 1921, in _getitem_column
    return self._get_item_cache(key)
  File "C:\Python34\lib\site-packages\pandas\core\generic.py", line 1090, in _get_item_cache
    values = self._data.get(item)
  File "C:\Python34\lib\site-packages\pandas\core\internals.py", line 3102, in get
    loc = self.items.get_loc(item)
  File "C:\Python34\lib\site-packages\pandas\core\index.py", line 1692, in get_loc
    return self._engine.get_loc(_values_from_object(key))
  File "pandas\index.pyx", line 137, in pandas.index.IndexEngine.get_loc (pandas\index.c:3979)
  File "pandas\index.pyx", line 157, in pandas.index.IndexEngine.get_loc (pandas\index.c:3843)
  File "pandas\hashtable.pyx", line 668, in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:12265)
  File "pandas\hashtable.pyx", line 676, in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:12216)
KeyError: 'ExtractedBodyText'

0 个答案:

没有答案