Reading data from ESTAT 'nrg_pc_204_c'

48 views
Skip to first unread message

Andreas Knaut

unread,
Jul 17, 2015, 3:23:22 AM7/17/15
to sdmx-...@googlegroups.com
Hi Leo,

thank you very much for building an api to the Eurostat database!
I am interested in getting access to the table of electricity prices ('nrg_pc_204_c'). I tried running the following code:

from pandasdmx import Request

# establish the connection to eurostat

estat = Request('ESTAT')

resp = estat.get(resource_type = 'data', resource_id = 'nrg_pc_204_c')


electricty_df = resp.write(s for s in resp.msg.data.series if s.key.GEO in ['DE'])


I always get an error "DateParseError: unknown string format". I think it could have something to do with the time format in the table, which is not only the year but with an additional string behind it.

Am I doing something wrong, or is there a better way to import the data?


Thank you very much in advance!

Andi


Jean Odoux

unread,
May 31, 2016, 4:04:15 AM5/31/16
to Statistical data and metadata exchange with SDMX and Python
Hi Andreas, 

I just faced that issue on this very dataset and found the answer in the docs: you should add 'parse_time=False' upon calling the write method: something along the lines of resp.write((i for i in resp.msg.data.series if i.key.GEO in ['DE']), parse_time=False)

Regards,
Jean
Reply all
Reply to author
Forward
0 new messages