Time Series retrieval using Python API shows NaN as result

I am using the eikon python api to extract some data.

I am doing the below:-
ek.get_timeseries(["912828N30="],
["TR.YieldToMaturityAnalytics"],
start_date="2018-10-09",
end_date="2018-10-10")
I get NaN for all the dates.

However, I can extract the same data via excel api as below:-
TR("912828N30","TR.YieldToMaturityAnalytics(ValuationDate=#1)",,E2,D2)
where D2 is set to the dates : 2018-10-09 and 2018-10-10

Best Answer

  • Hi @John Altair.Bautista

    To replicate Eikon Excel in Python API you need to use syntax below:

    RICS = ['912828N30'] 
    fields = ['TR.YieldToMaturityAnalytics(ValuationDate=2018-10-09)']
    df,err = ek.get_data(RICS,fields)
    df

    It is not possible to retrieve timeseries for this data item in a single call in Eikon Excel. Please check the syntax as most probably cell E2 is the destination cell of the output.

Answers