'this error occurs only with some stocks, for instance with NFLX, KO or MCD, but not with AAPL or INFy both with yfinance 0.1.63 and 0.1.69, pandas 1.2.3 or 1.4'
import yfinance as yf
from pandas_datareader import data
import os
import numpy as np
import pandas as pd
aapl = yf.download('NFLX', start="2019-01-01", end="2022-01-28")
#aapl = data.DataReader("^VIX", start='2021-1-1', end='2022-01-28', data_source='yahoo')
print(aapl.tail())
Was trying to download a string of tickers when i ran into this problem. pip install -U yfinance pandas
fixed it.
After upgrading to yfinance version 0.1.70, the problem has gone. My version of pandas is 1.4.1.
use pip install -U yfinance pandas
to update.
For reference, my version of yfinance was 0.1.63 and pandas was 1.4.1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With