ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
14.89k stars 2.44k forks source link

fix keyerror with single symbol list to Tickers #2065

Closed antoniouaa closed 1 month ago

antoniouaa commented 1 month ago

Tentative PR to fix longstanding issue #899

I don't see any good reason to treat single element symbol lists passed to yfinance.Tickers as something special, instead perform the pandas.concat like you would normally (with multiple tickers).

Avoids a KeyError raised here https://github.com/ranaroussi/yfinance/blob/9e2252e4516304efbd52d05ad66a5beb9a900e5e/yfinance/tickers.py#L83

Would help if there were tests that covered Tickers.