Ich versuche, die TA-Lib in Python auf Ubuntu 12.04 als described in the official documentation zu verwenden. Wenn jedoch pandas DataFrame
s oder Series
verwenden, wie es in mehreren Beispielen auf unterschiedliche Quellen gezeigt, ich folgenden TypeError
erhalten:Python TA-Lib arbeitet nicht mit Pandas-Serie
Traceback (most recent call last): File "test1.py", line 14, in analysis['rsi'] = ta.RSI(spy.Close) TypeError: Argument 'real' has incorrect type (expected numpy.ndarray, got Series)
Bei der Ausführung z.B. Dieser Code:
import pandas.io.data as data
import pandas as pd
import talib as ta
import matplotlib.pyplot as plt
# Download SP500 data with pandas
spyidx = data.get_data_yahoo('SPY', '2013-01-01')
analysis = pd.DataFrame(index = spyidx.index)
analysis['rsi'] = ta.RSI(spyidx.Close)
Was ist schief gelaufen?