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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
0 0 0 1

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'


eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Upvote
Accepted
39.2k 75 11 27

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.

icon clock
10 |1500

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

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

1615306548655.png (62.0 KiB)
Upvotes
18k 21 12 20

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


ahs1.png (29.1 KiB)
icon clock
10 |1500

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

Upvotes
39.2k 75 11 27

Use RDP Library for Python, e.g.

rdp.get_historical_price_summaries('GB5YIL=RR,
                                   fields=['INT_BEI'],
                                   start='2020-01-01')
icon clock
10 |1500

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

Upvotes
0 0 0 1

@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?

icon clock
10 |1500

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

Click below to post an Idea Post Idea