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

  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭
    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