I am trying to learn more about Python. I am trying to pull some data from Yahoo Finance. I have this code:
import yfinance as yf
from statsmodels.tsa.vector_ar.vecm import coint_johansen
symbols = ['AMZN', 'AAPL']
start = '2020-01-01'
end = '2024-01-16'
data = yf.download(symbols, start=start, end=end)['Adj Close']
specified_number = 0
coint_test_result = coint_johansen(data, specified_number, 1)
print("End")
It works as expected. I then change the symbols (line four to crypto currency pairs i.e.
symbols = ['BTCUSD', 'ETHUSD']
The code then errors on this line:
coint_test_result = coint_johansen(data, specified_number, 1)
The error is: zero-size array to reduction operation maximum which has no identity
Why does it error with cryptocurrency pairs as symbols?