pydata / pandas-datareader

Extract data from a wide range of Internet sources into a pandas DataFrame.
https://pydata.github.io/pandas-datareader/stable/index.html
Other
2.95k stars 681 forks source link

Eurostat not working on some data series #205

Open asavagar opened 8 years ago

asavagar commented 8 years ago

This might be related to a similar open issue here

The following example works great

df = web.DataReader("tran_sf_railac", 'eurostat') df

But attempting to read any business demography statistics fails. For example

df = web.DataReader("bd_9ac_l_form_r2", 'eurostat') df

The following error is returned.

`--------------------------------------------------------------------------- ValueError Traceback (most recent call last)

in () ----> 1 df = web.DataReader("bd_9ac_l_form_r2", 'eurostat') 2 df /usr/local/lib/python2.7/dist-packages/pandas_datareader/data.pyc in DataReader(name, data_source, start, end, retry_count, pause, session) 122 return EurostatReader(symbols=name, start=start, end=end, 123 retry_count=retry_count, pause=pause, --> 124 session=session).read() 125 else: 126 raise NotImplementedError( /usr/local/lib/python2.7/dist-packages/pandas_datareader/base.pyc in read(self) 73 def read(self): 74 """ read data """ ---> 75 return self._read_one_data(self.url, self.params) 76 77 def _read_one_data(self, url, params): /usr/local/lib/python2.7/dist-packages/pandas_datareader/eurostat.pyc in _read_one_data(self, url, params) 33 34 resp = self._get_response(url) ---> 35 data = read_sdmx(resp.content, dsd=dsd) 36 37 try: /usr/local/lib/python2.7/dist-packages/pandas_datareader/io/sdmx.pyc in read_sdmx(path_or_buf, dtype, dsd) 51 root = ET.fromstring(xdata) 52 ---> 53 structure = _get_child(root, _MESSAGE + 'Structure') 54 idx_name = structure.get('dimensionAtObservation') 55 dataset = _get_child(root, _DATASET) /usr/local/lib/python2.7/dist-packages/pandas_datareader/io/sdmx.pyc in _get_child(element, key) 143 return elements[0] 144 elif len(elements) == 0: --> 145 raise ValueError("Element {0} contains no {1}".format(element.tag, key)) 146 else: 147 raise ValueError("Element {0} contains multiple {1}".format(element.tag, key)) ValueError: Element {http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message}GenericData contains no {http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message}Structure `
asavagar commented 8 years ago

Using similar data from the so-called 'main tables', here works well.

For example, the following works well

df4 = web.DataReader("tin00142", 'eurostat')
df4
natashawatkins commented 7 years ago

I previously had lfsi_emp_a working, but now am getting this error. Any ideas?