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

error encountered in yahoo downloader in the very first tutorial notebook #58

Open
RandyChen233 opened this issue Apr 9, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@RandyChen233
Copy link

Hi,

I tried running the tutorial in Google colab (the first tutorial notebook), and everything at the beginning ran without errors until this line

df = YahooDownloader(start_date = TRAIN_START_DATE,
                     end_date = TRADE_END_DATE,
                     ticker_list = config_tickers.DOW_30_TICKER).fetch_data()


I'm getting the following error:

[*********************100%***********************]  1 of 1 completed

1 Failed download:
- AXP: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- AMGN: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- AAPL: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- BA: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- CAT: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- CSCO: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- CVX: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- GS: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- HD: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- HON: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- IBM: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- INTC: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- JNJ: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- KO: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- JPM: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- MCD: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- MMM: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- MRK: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- MSFT: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- NKE: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- PG: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- TRV: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- UNH: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- CRM: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- VZ: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- V: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- WBA: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- WMT: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- DIS: No data found for this date range, symbol may be delisted
[*********************100%***********************]  1 of 1 completed

1 Failed download:
- DOW: No data found for this date range, symbol may be delisted
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-50-b49b1e107d2c>](https://localhost:8080/#) in <cell line: 1>()
----> 1 df = YahooDownloader(start_date = TRAIN_START_DATE,
      2                      end_date = TRADE_END_DATE,
      3                      ticker_list = config_tickers.DOW_30_TICKER).fetch_data()

[/usr/local/lib/python3.9/site-packages/finrl/meta/preprocessor/yahoodownloader.py](https://localhost:8080/#) in fetch_data(self, proxy)
     58                 num_failures += 1
     59         if num_failures == len(self.ticker_list):
---> 60             raise ValueError("no data is fetched.")
     61         # reset the index, we want to use numbers as index instead of dates
     62         data_df = data_df.reset_index()

ValueError: no data is fetched.

Is yahooDownloader broken?

@shql-tgr
Copy link

The problem (at least in my case) was a conflict between the newest version of Pandas (2.0.0) and yfinance. Downgrading Pandas to 1.5.3 did the trick (if you're using Colab, just run !pip install pandas==1.5.3 before importing the library)

@YangletLiu YangletLiu added the bug Something isn't working label Jun 6, 2023
@randheerDas
Copy link

I did downgrade pandas to 1.5.3. This did not resolve the issue.
Is somebody from Finrl Team looking into this? This is very important, as we plan to demonstrate these capabilities to an important customer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants