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

Problem of fetching SP500 component stock list #961

Open
edmondpqyyy opened this issue Apr 25, 2023 · 1 comment
Open

Problem of fetching SP500 component stock list #961

edmondpqyyy opened this issue Apr 25, 2023 · 1 comment

Comments

@edmondpqyyy
Copy link

I got an error about fetching the list of SP500 component stock, shown below:

`import pandas_datareader as pdr

define start and end dates

start_date = '2022-01-01'
end_date = '2022-12-31'

get the S&P 500 component tickers for each month in 2022

sp500_components = pdr.get_components_yahoo('^GSPC')`


ImmediateDeprecationError Traceback (most recent call last)
Input In [136], in <cell line: 8>()
5 end_date = '2022-12-31'
7 # get the S&P 500 component tickers for each month in 2022
----> 8 sp500_components = pdr.get_components_yahoo('^GSPC')

File ~/opt/anaconda3/lib/python3.9/site-packages/pandas_datareader/yahoo/components.py:30, in _get_data(idx_sym)
9 def _get_data(idx_sym): # pragma: no cover
10 """
11 Returns DataFrame containing list of component information for
12 index represented in idx_sym from yahoo. Includes component symbol
(...)
28 idx_df : DataFrame
29 """
---> 30 raise ImmediateDeprecationError(DEP_ERROR_MSG.format("Yahoo Components"))
31 stats = "snx"
32 # URL of form:
33 # http://download.finance.yahoo.com/d/quotes.csv?s=@%5EIXIC&f=snxl1d1t1c1ohgv

ImmediateDeprecationError:
Yahoo Components has been immediately deprecated due to large breaks in the API without the
introduction of a stable replacement. Pull Requests to re-enable these data
connectors are welcome.

See https://github.com/pydata/pandas-datareader/issues

@Invesst
Copy link

Invesst commented Apr 24, 2024

Running into this same error. Any update?

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

No branches or pull requests

2 participants