Selecting two pairs together: pair = ['EURSUD=X', 'DX=F']
when calling these pairs into a df I'm getting Nan values and duplicates, first time I've encountered this since 13 Jan 2023. Also, there seems to be different lengths of values when I call the method len() to count the number of observations for each pair. This is affecting my ML & Ai model in tf given the X, y variables have different lengths or the values don't match!
I have sympathy for your ML but you didn't read the New Issue default message.
Who crums, what was the message????
https://github.com/ranaroussi/yfinance/issues/new?assignees=&labels=&template=bug_report.md&title=
Delete this default message and submit your bug report here, providing the following as best you can:
- Simple code that reproduces your problem
- Error message, with traceback if shown
- Info about your system:
- yfinance version
- operating system
-Sample Code:
Date. DX-F. EURUSD=X 2004-01-01 00:00:00 | NaN | 1.258194 2004-01-02 00:00:00 | NaN | 1.258194 2004-01-02 05:00:00 | 86.930000 | NaN 2004-01-05 00:00:00 | NaN | 1.268698 2004-01-05 05:00:00 | 86.349998 | NaN
- latest version
- Mac OS
That's not code. Good luck!
pairs = ['EURUSD=X', DX=F]
data = yf.download(pairs, '2004-01-01')['Adj Close'] data.index = pd.to_datetime(data.index)
df1 = pd.DataFrame(data) df1 = df1.tz_localize(None)
df1.head()
``
'DX=F'
I have sympathy for your ML but you didn't read the New Issue default message.
The stuff you have to deal with :-) Impressed by your efforts with all of this!
Hi anglosachs, unrelated to code itself but I would recommend using the cash ticker for the US Dollar index (DX-Y.NYB) instead of using the front-month futures (DX=F). The front month futures suffers from gaps at each roll.
Set ignore_tz=True. Read the README