Original answer (works but more lines of code) To try this on Google Colab use (as shown here): ! pip install pycryptodome pycryptodomexĪlthough past week I could not make it work, I have tried again, and I can confirm that the pdr_override() workaround mentioned below by Nikhil Mulley is working now (at least with yfinance 0.2.3 and pandas-datareader 0.10.0). This can also be done using pip for all the commands instead of conda (see Update 1 below). Notice I am using the commit hash here instead of the branch name, because it is Yahoo!_Issue#952 and there is an issue with hash characters when using pip this way. Pip install pycrypto* packages are dependencies I have to install to make it work. The version from the pull request can be installed with this 3 lines: conda install pycryptodome pycryptodomex In the same Github thread a fix is reported, implemented in a pull request from Github user raphi6. As per the discussion here Yahoo made changes to their API that broke compatibility with previous pandas datareader versions. None of the solutions reported here so far worked for me. ![]() TypeError: string indices must be integers ![]() Stocks = self._read_one_data(self.url, self._get_params(sym))įile "C:\Users\Deepak Shetter\PycharmProjects\100DAYSOFPYTHON\venv\lib\site-packages\pandas_datareader\yahoo\daily.py", line 153, in _read_one_dataĭata = j Return YahooDailyReader(*args, **kwargs).read()įile "C:\Users\Deepak Shetter\PycharmProjects\100DAYSOFPYTHON\venv\lib\site-packages\pandas_datareader\base.py", line 258, in readįile "C:\Users\Deepak Shetter\PycharmProjects\100DAYSOFPYTHON\venv\lib\site-packages\pandas_datareader\base.py", line 268, in _dl_mult_symbols When I run this code, I get error "TypeError: string indices must be integers".Įdit : I have updated the code and passed list as symbol parameter but it still shows the same errorĮrror : Traceback (most recent call last):įile "C:\Users\Deepak Shetter\PycharmProjects\100DAYSOFPYTHON\mp3downloader.py", line 7, in ĭata = pandas_datareader.get_data_yahoo(symbols=, start=start, end=end)įile "C:\Users\Deepak Shetter\PycharmProjects\100DAYSOFPYTHON\venv\lib\site-packages\pandas_datareader\data.py", line 80, in get_data_yahoo Data = pandas_datareader.get_data_yahoo(symbols=stock_list, start=start, end=end)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |