Skip to content

Eurostat not working on some data series #205

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

Open
asavagar opened this issue Jun 13, 2016 · 2 comments
Open

Eurostat not working on some data series #205

asavagar opened this issue Jun 13, 2016 · 2 comments

Comments

@asavagar
Copy link

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
Copy link
Author

asavagar commented Jun 13, 2016

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
Copy link

natashawatkins commented Apr 27, 2017

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

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