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

oecd "QNA" (quarterly national accounts) does not work #284

Open handrew opened 7 years ago

handrew commented 7 years ago

df = web.DataReader('QNA', 'oecd', end=datetime.datetime(2016, 6, 1))

gives me a ValueError: Shape of passed values is (416640, 350), indices imply (808976, 350)

gliptak commented 5 years ago
>>> import pandas_datareader as web
>>> web.__version__
'0.8.0'
>>> df = web.DataReader('QNA', 'oecd', start="2016-3-1", end="2016-6-1")
Traceback (most recent call last):
  File "/opt/conda/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 1677, in create_block_manager_from_blocks
    make_block(values=blocks[0], placement=slice(0, len(axes[0])))
  File "/opt/conda/lib/python3.7/site-packages/pandas/core/internals/blocks.py", line 3265, in make_block
    return klass(values, ndim=ndim, placement=placement)
  File "/opt/conda/lib/python3.7/site-packages/pandas/core/internals/blocks.py", line 128, in __init__
    "{mgr}".format(val=len(self.values), mgr=len(self.mgr_locs))
ValueError: Wrong number of items passed 392150, placement implies 739970

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.7/site-packages/pandas/util/_decorators.py", line 208, in wrapper
    return func(*args, **kwargs)
  File "/home/jovyan/.local/lib/python3.7/site-packages/pandas_datareader/data.py", line 481, in DataReader
    session=session,
  File "/home/jovyan/.local/lib/python3.7/site-packages/pandas_datareader/base.py", line 100, in read
    return self._read_one_data(self.url, self.params)
  File "/home/jovyan/.local/lib/python3.7/site-packages/pandas_datareader/base.py", line 112, in _read_one_data
    return self._read_lines(out)
  File "/home/jovyan/.local/lib/python3.7/site-packages/pandas_datareader/oecd.py", line 26, in _read_lines
    df = read_jsdmx(out)
  File "/home/jovyan/.local/lib/python3.7/site-packages/pandas_datareader/io/jsdmx.py", line 54, in read_jsdmx
    df = pd.DataFrame(values, columns=columns, index=index)
  File "/opt/conda/lib/python3.7/site-packages/pandas/core/frame.py", line 439, in __init__
    mgr = init_ndarray(data, index, columns, dtype=dtype, copy=copy)
  File "/opt/conda/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 213, in init_ndarray
    return create_block_manager_from_blocks(block_values, [columns, index])
  File "/opt/conda/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 1687, in create_block_manager_from_blocks
    construction_error(tot_items, blocks[0].shape[1:], axes, e)
  File "/opt/conda/lib/python3.7/site-packages/pandas/core/internals/managers.py", line 1718, in construction_error
    "Shape of passed values is {0}, indices imply {1}".format(passed, implied)
ValueError: Shape of passed values is (290, 392150), indices imply (290, 739970)
mlovchikova commented 4 years ago

same error with "SNA_TABLE6A", "SNA_TABLE7A", "SNA_TABLE8A","SNA_TABL9A".