Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 1 , cant run the code . #18

Open
VISION3635 opened this issue Sep 28, 2023 · 1 comment
Open

Chapter 1 , cant run the code . #18

VISION3635 opened this issue Sep 28, 2023 · 1 comment

Comments

@VISION3635
Copy link

xd im getting this error . thx for rewieving this issue , not sure if its a library mistake or something else ; as im a beginner ... thx for helping me out ( ;

D:\algo_trding_learning\venv\Scripts\python.exe D:\algo_trding_learning\buylowsellhigh.py
Traceback (most recent call last):
File "D:\algo_trding_learning\buylowsellhigh.py", line 5, in
goog_data = data.DataReader('GOOG', 'yahoo', start_date, end_date)
File "D:\algo_trding_learning\venv\lib\site-packages\pandas\util_decorators.py", line 213, in wrapper
return func(*args, **kwargs)
File "D:\algo_trding_learning\venv\lib\site-packages\pandas_datareader\data.py", line 370, in DataReader
return YahooDailyReader(
File "D:\algo_trding_learning\venv\lib\site-packages\pandas_datareader\base.py", line 253, in read
df = self._read_one_data(self.url, params=self._get_params(self.symbols))
File "D:\algo_trding_learning\venv\lib\site-packages\pandas_datareader\yahoo\daily.py", line 153, in _read_one_data
data = j["context"]["dispatcher"]["stores"]["HistoricalPriceStore"]
TypeError: string indices must be integers

Process finished with exit code 1

@relentlesss
Copy link

Traceback (most recent call last):
File "D:\algo_trding_learning\buylowsellhigh.py", line 5, in
goog_data = data.DataReader('GOOG', 'yahoo', start_date, end_date)
TypeError: string indices must be integers

Try replacing line 5 with the following:
goog_data = pdr.get_data_yahoo('GOOG', start_date, end_date)

Also, add the below at the beginning of your file:
from pandas_datareader import data as pdr
import yfinance as yfin
yfin.pdr_override()

The problem was already addressed in this previous issue.
#17 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants