import pandas
df6 = pandas.read_csv("https://www.pythonhow.com/supermarkets.csv")
df6.set_index('test')
我希望输出添加一个行标题“测试”,但在我的 jupyter 笔记本中返回以下错误。
KeyError Traceback (most recent call last)
c:\users\sunair raj\appdata\local\programs\python\python37-32\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
3077 try:
-> 3078 return self._engine.get_loc(key)
3079 except KeyError:
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'fdfdf'
在处理上述异常的过程中,又发生了一个异常:
慕村9548890
相关分类