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.

Best Answer

Answers

  • 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.