How do i fix this RemoteDataError, in Pandas DataReader

Viewed 2156

i want to download FTSE historical data but i cant download it, i have reinstalled pandas_datareader but the problem still persisted

there are no issues downloading other tickers such as S&P, Dow Jones ,etc only FTSE

this is the following code i used:

import numpy as np

import pandas as pd

from pandas_datareader import data as wb

FTSE = wb.DataReader('^FTSE', data_source='yahoo', start='1990-1-1')

i get the following error message when i perform the above code and same error occurs in Anaconda3

Blockquote

" --------------------------------------------------------------------------- RemoteDataError Traceback (most recent call last) in () ----> 1 FTSE = wb.DataReader('^FTSE', data_source='yahoo', start='2000-1-1')

C:\Users****\Anaconda2\lib\site-packages\pandas_datareader\data.pyc in DataReader(name, data_source, start, end, retry_count, pause, session, access_key) 308 adjust_price=False, chunksize=25, 309 retry_count=retry_count, pause=pause, --> 310 session=session).read() 311 312 elif data_source == "google":

C:\Users****\Anaconda2\lib\site-packages\pandas_datareader\base.pyc in read(self) 208 if isinstance(self.symbols, (compat.string_types, int)): 209 df = self._read_one_data(self.url, --> 210 params=self._get_params(self.symbols)) 211 # Or multiple symbols, (e.g., ['GOOG', 'AAPL', 'MSFT']) 212 elif isinstance(self.symbols, DataFrame):

C:\Users****\Anaconda2\lib\site-packages\pandas_datareader\yahoo\daily.pyc in _read_one_data(self, url, params) 134 except KeyError: 135 msg = 'No data fetched for symbol {} using {}' --> 136 raise RemoteDataError(msg.format(symbol, self.class.name)) 137 138 # price data

RemoteDataError: No data fetched for symbol ^FTSE using YahooDailyReader "

2 Answers

You need to escape the ^ character:

FTSE = wb.DataReader('\^FTSE', data_source='yahoo', start='1990-1-1')

Though I'm unsure why this only seems to be an issue for ^STI and ^FTSE, but not ^GSPC, ^FCHI, ^RUT or any other indices, so I can't give an explanation.

Related