URT icon indicating copy to clipboard operation
URT copied to clipboard

running Python, ADF_d error

Open rudmac opened this issue 5 years ago • 0 comments

After: make USE_OPENMP=1 USE_BLAZE=1 USE_BLAS=1 python setup.py build_ext --inplace --force ...

adf.csv is saved from Example2.cpp

Example2.cpp ... urt::Vector<double> data = urt::wiener_process<double>(nobs); urt::WriteToCSV("adf.csv", data); ...

Python code:

adf = pd.read_csv('adf.csv', sep=',', header=None) test = urt.ADF_d(adf[0].values, lags=10, trend='ct') test.show()

Result is:

TypeError Traceback (most recent call last) in 1 adf = pd.read_csv('adf.csv', sep=',', header=None) ----> 2 test = urt.ADF_d(adf[0].values, lags=10, trend='ct') 3 test.show()

~/URT/Python/CyURT.pyx in CyURT.ADF_d.init()

TypeError: expected bytes, str found

Head of adf.csv print(adf[0].head())

0 -0.150035 1 -0.594445 2 -2.272570 3 0.203642 4 -0.325208 Name: 0, dtype: float64

Also, same error:

>python benchmark.py Traceback (most recent call last): File "benchmark.py", line 25, in test = urt.ADF_d(data, method='AIC') File "CyURT.pyx", line 243, in CyURT.ADF_d.init self.adf = unique_ptr[ADF[double]](new ADF[double](xd, method, trend, regression)) TypeError: expected bytes, str found

rudmac avatar Dec 04 '18 15:12 rudmac