wie ihr sehen könnt habe ich folgenden KeyError und kann damit als Anfänger nichts anfangen.
Zurzeit arbeite ich mit demn Tutorials von pythonprogramming.net und komm nun nicht weiter aufgrund des Fehlers.
Das exakte tut findet ihr hier https://pythonprogramming.net/machine-l ... r-finance/ . Ich habe schon unzählige male probiert panda, numpy zu deinstallieren und habe natürlich auch Lösungsansetze verfolgt die mir nicht geholfen haben. Im Grunde war die Ausgangssitutation mit dieser Fehlermeldung behaftet. (bin mir nicht mehr ganz sicher, zu lange probiert und nichts hat funktioniert)
Code: Alles auswählen
Traceback (most recent call last):
File "Python_Finance.py", line 4, in <module>
import matplotlib.pyplot as plt
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 122, in <module>
from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label
File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 32, in <module>
import numpy as np
ImportError: No module named numpy
Auch wurde scipy darüber installiert nur ohne Erfolg.
Nach der Installation von numpy‑1.11.3+mkl‑cp27‑cp27m‑win32.whl kommt dann die beschriebene Fehlermeldung.
Code: Alles auswählen
Traceback (most recent call last):
File "Python_Finance.py", line 188, in <module>
do_ml('XOM')
File "Python_Finance.py", line 165, in do_ml
X, y, df = extract_featuresets(ticker)
File "Python_Finance.py", line 159, in extract_featuresets
y = df['{}_target'.format(ticker)].values
File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 2059, in __getitem__
return self._getitem_column(key)
File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 2066, in _getitem_column
return self._get_item_cache(key)
File "C:\Python27\lib\site-packages\pandas\core\generic.py", line 1386, in _get_item_cache
values = self._data.get(item)
File "C:\Python27\lib\site-packages\pandas\core\internals.py", line 3543, in get
loc = self.items.get_loc(item)
File "C:\Python27\lib\site-packages\pandas\indexes\base.py", line 2136, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas\index.pyx", line 132, in pandas.index.IndexEngine.get_loc (pandas\index.c:4433)
File "pandas\index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas\index.c:4279)
File "pandas\src\hashtable_class_helper.pxi", line 732, in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:13742)
File "pandas\src\hashtable_class_helper.pxi", line 740, in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:13696)
KeyError: 'ZTS_target'
Vielleicht kennt jemand das Tutorial/Problem und kann mir vielleicht helfen.