Upgrade from Eikon -> Workspace. Learn about programming differences.

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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-api
icon clock
10 |1500

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

Hello @mayumi.ojima,

Thank you for your participation in the forum.

Is one of the replies below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

Hello @mayumi.ojima,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

-AHS

Upvote
Accepted
39.4k 77 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 512.0 KiB each and 1.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
18.2k 21 13 21

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 512.0 KiB each and 1.0 MiB total.

Upvotes
39.4k 77 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 512.0 KiB each and 1.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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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