@@ -305,12 +305,26 @@ for United States, is as simple as taking the ticker segment from the URL path
305
305
306
306
.. code-block :: ipython
307
307
308
- import os
309
- import pandas_datareader.data as web
308
+ In [1]: import os
310
309
311
- f = web.DataReader('ticker=RGDPUS', 'econdb')
312
- f.head()
310
+ In [2]: import pandas_datareader as pdr
313
311
312
+ In [3]: f = pdr.get_data_econdb('ticker=RGDPUS')
313
+ In [4]: f.head()
314
+ Out[4]:
315
+ TableName T10106
316
+ SeriesCode A191RX
317
+ Table Table 1.1.6. Real Gross Domestic Product, Ch...
318
+ Series description Gross domestic product
319
+ CL_UNIT Level
320
+ CL_FREQ Q
321
+ Note Table 1.1.6. Real Gross Domestic Product, Ch...
322
+ TIME_PERIOD
323
+ 2018-01-01 18437128
324
+ 2018-04-01 18565696
325
+ 2018-07-01 18699748
326
+ 2018-10-01 18733740
327
+ 2019-01-01 18835412
314
328
315
329
The code snippet for exporting the whole dataset, or its filtered down subset,
316
330
can be generated by using the Export -> Pandas Python3 functionality
@@ -319,16 +333,47 @@ such as the Eurostat's `GDP and main components <https://www.econdb.com/dataset/
319
333
320
334
.. code-block :: ipython
321
335
322
- import os
323
- import pandas_datareader.data as web
336
+ In [1]: import os
324
337
325
- df = web.DataReader('dataset=NAMQ_10_GDP&v=Geopolitical entity (reporting)&h=TIME&from=2018-05-01&to=2021-01-01&GEO=[AL,AT,BE,BA,BG,HR,CY,CZ,DK,EE,EA19,FI,FR,DE,EL,HU,IS,IE,IT,XK,LV,LT,LU,MT,ME,NL,MK,NO,PL,PT,RO,RS,SK,SI,ES,SE,CH,TR,UK]&NA_ITEM=[B1GQ]&S_ADJ=[SCA]&UNIT=[CLV10_MNAC]', 'econdb')
326
- df.columns
338
+ In [2]: import pandas_datareader as pdr
339
+
340
+ In [3]: df = pdr.get_data_econdb('dataset=NAMQ_10_GDP&v=Geopolitical entity (reporting)'
341
+ '&h=TIME&from=2018-05-01&to=2021-01-01'
342
+ '&GEO=[UK,ES,IT,DE,FR,CH,AT]&NA_ITEM=[B1GQ]'
343
+ '&S_ADJ=[SCA]&UNIT=[CLV10_MNAC]')
344
+ In [4]: df.head()
345
+ Out[4]:
346
+ Frequency Quarterly ...
347
+ Unit of measure Chain linked volumes (2010), million units of national currency ...
348
+ Seasonal adjustment Seasonally and calendar adjusted data ...
349
+ National accounts indicator (ESA10) Gross domestic product at market prices ...
350
+ Geopolitical entity (reporting) Austria ... Switzerland
351
+ TIME_PERIOD ...
352
+ 2018-07-01 83427 ... 181338
353
+ 2018-10-01 84268 ... 181767
354
+ 2019-01-01 84919 ... 182039
355
+ 2019-04-01 84476 ... 182848
356
+ 2019-07-01 84822 ... 183866
357
+
358
+ In both cases, metadata for the requested Econdb series or dataset
359
+ is in the ``MultiIndex `` columns of the returned ``DataFrame ``,
360
+ and can be conveniently converted to a ``dict `` as demonstrated below
361
+
362
+ .. code-block :: ipython
363
+
364
+ In [5]: meta = df.columns.to_frame().iloc[0].to_dict() # first column, positionally
365
+ Out[5]: meta
366
+ {'Frequency': 'Quarterly',
367
+ 'Unit of measure': 'Chain linked volumes (2010), million units of national currency',
368
+ 'Seasonal adjustment': 'Seasonally and calendar adjusted data',
369
+ 'National accounts indicator (ESA10)': 'Gross domestic product at market prices',
370
+ 'Geopolitical entity (reporting)': 'Austria'}
327
371
328
372
Datasets can be located through Econdb's `search <https://www.econdb.com/search >`__
329
373
engine, or discovered by exploring the `tree <https://www.econdb.com/tree/ >`__
330
374
of available statistical sources.
331
375
376
+
332
377
.. _remote_data.enigma :
333
378
334
379
Enigma
0 commit comments