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
32 8 6 7

What does ,err do?

For the following request, what does the , err do?

data_grid, err = ek.get_data(['IBM', 'GOOG.O', 'MSFT.O'],
                             ['TR.TotalReturnYTD', 'TR.WACCBeta', 'YRHIGH', 'YRLOW'])

I notice when keeping ' ,err' the dataframe is displayed in a nice format in my Jupyter Notebook whereas without it looks to be formatted in a tuple or something. Any explanation would be much appreciated. Thank you.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apierror
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
Accepted
18.2k 21 13 21

Hi @bill39

For more information, please visit https://www.w3schools.com/python/python_tuples.asp


ahs2.png (11.2 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
18.2k 21 13 21

ahs.png (17.2 KiB)
ahs2.png (15.0 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
32 8 6 7

Hi @chavalit.jintamalit,


Why is my output a tuple when I don't write ", err" but a dataframe when I do?


Thanks

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
18.2k 21 13 21

Hi @bill39

You can access by index.


ahs1.png (14.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
32 8 6 7

Ah I see thank you! So by using the comma we are returning the dataframe to df and the list of errors to err.

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.