After upgrading packages in a conda env, talib cannot accept
dataframe as input, the error message looks like
TypeError: Argument 'xxx' has incorrect type (expected numpy.ndarray, got DataFrame)
:
Traceback (most recent call last):
File "/data/1.py", line 7, in <module>
df['SMA_5'] = ta.SMA(df['Close'], timeperiod=5)
File "/data/miniconda3/envs/a/lib/python3.10/site-packages/talib/__init__.py", line 64, in wrapper
result = func(*_args, **_kwds)
TypeError: Argument 'real' has incorrect type (expected numpy.ndarray, got DataFrame)
Most of the web search results are misleading, like changing the df
into np array. Since the code works before updating packages, the
problem should be package incompatibility issue.