Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running Python, ADF_d error #7

Open
rudmac opened this issue Dec 4, 2018 · 0 comments
Open

running Python, ADF_d error #7

rudmac opened this issue Dec 4, 2018 · 0 comments

Comments

@rudmac
Copy link

rudmac commented Dec 4, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant