How to get BEI in Python

I would like to get the break even inflation rate from UK 5 year gilts.

My draft code is below but it does not work.

====

symbolList=["GB5YIL=RR"]
df = ek.get_timeseries(symbolList,["INT_BEI.Value"],start_date="2020-01-01")
df.plot()

====
TypeError: float() argument must be a string or a number, not 'NAType'


Best Answer

  • There are 3 parameters used to define the time range of timeseries requested: start, end and count. The logic is that data is retrieved from end to start up to the value of count. The default value of count is 20 and end defaults to the latest available point in time. This is how the request returns 20 rows back from today's date. I appreciate for this specific example it's not an intuitive behavior, as the only parameter you explicitly specify ends up being ignored. I recommend explicitly setting both start and end parameters, in which case the full length of timeseries between start and end will be returned.

Answers

  • Hi @mayumi.ojima

    Please try this code:

    #pip install refinitiv.dataplatform

    import refinitiv.dataplatform as rdp
    rdp.open_desktop_session('a_valid_appkey')
    df = rdp.get_historical_price_summaries('GB5YIL=RR', fields=["INT_BEI"], start='2020-01-01')
    df

    image

  • Use RDP Library for Python, e.g.

    rdp.get_historical_price_summaries('GB5YIL=RR,
    fields=['INT_BEI'],
                                       start='2020-01-01')
  • @chavalit.jintamalit @Alex Putkov Thank you so much. Your code works well. But just one quick question. Although we set start date from 2020-01-01, why does the data start from Feb 2021?

  • Thank you for quick reply. Very helpful. Now I can get the data, setting both start and end points.

    image