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

KeyError: 'structure' for OECD #997

Open
r-matsuzaka opened this issue Oct 6, 2024 · 1 comment
Open

KeyError: 'structure' for OECD #997

r-matsuzaka opened this issue Oct 6, 2024 · 1 comment

Comments

@r-matsuzaka
Copy link

Issue

I just followed the documentation.
But it does not work.

import pandas_datareader.data as web

import datetime

df = web.DataReader('TUD', 'oecd')

print(df.columns)


df[['Japan', 'United States']]

Result

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
[<ipython-input-7-9b54b41f1ad6>](https://localhost:8080/#) in <cell line: 5>()
      3 import datetime
      4 
----> 5 df = web.DataReader('TUD', 'oecd')
      6 
      7 print(df.columns)

5 frames
[/usr/local/lib/python3.10/dist-packages/pandas_datareader/io/jsdmx.py](https://localhost:8080/#) in read_jsdmx(path_or_buf)
     42         data = json.loads(jdata, object_pairs_hook=OrderedDict)
     43 
---> 44     structure = data["structure"]
     45     index = _parse_dimensions(structure["dimensions"]["observation"])
     46     columns = _parse_dimensions(structure["dimensions"]["series"])

KeyError: 'structure'

Ref

@r-matsuzaka r-matsuzaka changed the title KeyError: 'structure' KeyError: 'structure' for OECD Oct 6, 2024
@r-matsuzaka
Copy link
Author

I guess the main reason of this issue coming from the updates of the API.
Please refer to the following documents to update your queries by the end of 2023:

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

1 participant