YFData.download() failing with certain instruments (ValueError: Symbols have mismatching columns) #770
arnobeutch
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
Sorry if it is obvious, but I'm completely lost. Consider this:
`def main():
symbols = ["AAPL", "GOOG", "NVDA"] # ! works
# symbols = ["BTC-USD","ETH-USD"] # ! works
# symbols = ["BTC-USD","ETH-USD"] # ! works
# symbols = ["BTC-USD","ETH-USD", "XMR-USD", "ADA-USD"] # ! works
# symbols = ["SPY", "QQQ", "^FCHI"] # ! doesn't work
# symbols = ["AAPL", "GOOG", "FB"] # ! doesn't work
# symbols = ["AAPL", "GOOG", "SPY"] # ! doesn't work
As per the comment on each symbols = line: some will succeed, others will fail with
ValueError: Symbols have mismatching columns
.What am I missing ?! Many thanks.
Details:
(myvectorbt) mprz@fedora:~/MyVectorBT$ uv run test_vbt.py $FB: possibly delisted; no timezone found /home/mprz/MyVectorBT/.venv/lib64/python3.13/site-packages/vectorbt/data/base.py:527: UserWarning: Symbols have mismatching index. Dropping missing data points. data = cls.align_index(data, missing=missing_index) /home/mprz/MyVectorBT/.venv/lib64/python3.13/site-packages/vectorbt/data/base.py:527: UserWarning: Symbols have mismatching index. Dropping missing data points. data = cls.align_index(data, missing=missing_index) Traceback (most recent call last): File "/home/mprz/MyVectorBT/test_vbt.py", line 51, in <module> main() ~~~~^^ File "/home/mprz/MyVectorBT/test_vbt.py", line 16, in main price = vbt.YFData.download( ~~~~~~~~~~~~~~~~~~~^ symbols, ^^^^^^^^ ...<2 lines>... missing_index="drop", ^^^^^^^^^^^^^^^^^^^^^ ).get("Close") ^ File "/home/mprz/MyVectorBT/.venv/lib64/python3.13/site-packages/vectorbt/data/base.py", line 587, in download return cls.from_data( ~~~~~~~~~~~~~^ data, ^^^^^ ...<5 lines>... download_kwargs=kwargs ^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/home/mprz/MyVectorBT/.venv/lib64/python3.13/site-packages/vectorbt/data/base.py", line 528, in from_data data = cls.align_columns(data, missing=missing_columns) File "/home/mprz/MyVectorBT/.venv/lib64/python3.13/site-packages/vectorbt/data/base.py", line 437, in align_columns raise ValueError("Symbols have mismatching columns") ValueError: Symbols have mismatching columns
With VSCode using uv, pyproject.toml:
[project] name = "myvectorbt" version = "0.1.0" description = "Add your description here" readme = "README.md" requires-python = ">=3.13" dependencies = [ "ruff>=0.9.4", "vectorbt>=0.27.2", "yfinance>=0.2.52", ]
Running Python 3.13 as it's visible, and the venv has:
`(myvectorbt) mprz@fedora:~/MyVectorBT$ uv pip list
Package Version
asttokens 3.0.0
beautifulsoup4 4.12.3
certifi 2025.1.31
charset-normalizer 3.4.1
comm 0.2.2
contourpy 1.3.1
cycler 0.12.1
dateparser 1.2.0
decorator 5.1.1
dill 0.3.9
executing 2.2.0
fonttools 4.55.8
frozendict 2.4.6
html5lib 1.1
idna 3.10
imageio 2.37.0
ipython 8.32.0
ipywidgets 8.1.5
jedi 0.19.2
joblib 1.4.2
jupyterlab-widgets 3.0.13
kiwisolver 1.4.8
llvmlite 0.44.0
lxml 5.3.0
matplotlib 3.10.0
matplotlib-inline 0.1.7
multitasking 0.0.11
mypy-extensions 1.0.0
numba 0.61.0
numpy 2.1.3
packaging 24.2
pandas 2.2.3
parso 0.8.4
peewee 3.17.8
pexpect 4.9.0
pillow 11.1.0
platformdirs 4.3.6
plotly 5.24.1
prompt-toolkit 3.0.50
ptyprocess 0.7.0
pure-eval 0.2.3
pygments 2.19.1
pyparsing 3.2.1
python-dateutil 2.9.0.post0
pytz 2025.1
regex 2024.11.6
requests 2.32.3
ruff 0.9.4
schedule 1.2.2
scikit-learn 1.6.1
scipy 1.15.1
six 1.17.0
soupsieve 2.6
stack-data 0.6.3
tenacity 9.0.0
threadpoolctl 3.5.0
tqdm 4.67.1
traitlets 5.14.3
tzdata 2025.1
tzlocal 5.2
urllib3 2.3.0
vectorbt 0.27.2
wcwidth 0.2.13
webencodings 0.5.1
widgetsnbextension 4.0.13
yfinance 0.2.52`
Beta Was this translation helpful? Give feedback.
All reactions