Use fix_yahoo_Finance package, here provided pdr_override()
can fix problems that cannot be read
from pandas_datareader import data as pdr
import fix_yahoo_finance as yf
yf.pdr_override() # Used to fix, necessary
# Get data
data = pdr.get_data_yahoo("SPY", start="2017-01-01", end="2017-04-30")
# Print
print(data.head())
Similar Posts:
- [Solved] Pandas Read CSV Error: TypeError: Empty ‘DataFrame’: no numeric data to plot
- How to Solve ParserError: Error tokenizing data. C error: Expected 2 fields in line 53, saw 3
- pandas.read_ Oserror: initializing from file failed
- [mailbox usage] POP3, SMTP activation and setting method of Yahoo mailbox
- How to Solve sys:1: DtypeWarning: Columns (39,41,42,217) have mixed types.Specify dtype option on import or s
- Differences of urllib, urllib2, httplib and httplib2 libraries in Python
- [Solved] module functions cannot set METH_CLASS or METH_STATIC
- MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors
- Python pandas.read_ Oserror: initializing from file failed
- [Solved] JpaRepository Error: Paging query needs to have a Pageable parameter! Offending method public abstract