Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
4 0 1 4

cannot control the output layout of get_data

Hi,

    rics = ['0001.HK', '0002.HK']
    params = {'Frq': 'C', 'Period': 'FY2', 'Curn': 'USD', 'SDate': '2018-04-17','EDate':'2018-04-18','CH':'IN','RH':'calcdate'}
    rsp, err = ek.get_data(instruments = rics, fields = 'TR.EPSMean', parameters = params)

I hope the row header is date and the column header is instruments.

but the result is:

rsp
Out[69]: 
  Instrument  Earnings Per Share - Mean
0    0001.HK                   1.375680
1    0001.HK                   1.378931
2    0002.HK                   0.628250
3    0002.HK                   0.628250

It does not show date information.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
4.6k 26 7 22

@charles.wang change the fields list to

fields = ['TR.EPSMean.date', 'TR.EPSMean']
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks. It works, if using

fields = ['TR.EPSMean.calcdate', 'TR.EPSMean']

TR.EpsMean.date seems giving the date when the estimate is released.

but it still cannot control the output layout, if I prefer row header = date and column header = instruments. I hope the result would be like:

rsp.pivot(index = 'Calc Date', columns = 'Instrument', values = 'Earnings Per Share - Mean')
Out[78]: 
Instrument   0001.HK  0002.HK
Calc Date                   
2018-04-17  1.375680  0.62825
2018-04-18  1.378931  0.62825

but I am OK with this.

Thanks.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.