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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
32 5 4 2

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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonerror
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
Accepted
18k 21 12 20

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 5.0 MiB each and 10.0 MiB total.

Upvotes
18k 21 12 20

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 5.0 MiB each and 10.0 MiB total.

Upvotes
32 5 4 2

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 5.0 MiB each and 10.0 MiB total.

Upvotes
18k 21 12 20

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 5.0 MiB each and 10.0 MiB total.

Upvotes
32 5 4 2

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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea