TA-Lib / ta-lib-python

Python wrapper for TA-Lib (http://ta-lib.org/).
http://ta-lib.github.io/ta-lib-python
Other
9.49k stars 1.74k forks source link

talib.MAMA does not support Polars series? #510

Closed peascod206 closed 2 years ago

peascod206 commented 2 years ago

Sample code to reproduce this:

import talib import polars as pl import numpy as np

values = np.random.rand(100)*100 pl_values = pl.Series(values, dtype=pl.Float64) print(pl_values.len()) mv_mama,mv_fama = talib.MAMA(pl_values)

Running the code above ends up with the following error msg: TypeError: Argument 'real' has incorrect type (expected numpy.ndarray, got Series)

Any idea?

peascod206 commented 2 years ago

Solved this problem. I initially use conda install -channel conda-forge to install the ta-lib library and it turns out conda-forge only has 0.4.19 version. After install the latest 0.4.24, the above code could run smoothly without any problem.