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
1 0 0 2

Eikon Python API

https://pypi.org/project/eikon/

Version 1.0.1.

When ask CUSIP, API returns formatted data.

For example

IMAX,4.5245e+113 (WRONG, should be 45245E109)

NNFC,6.3008e+113 (WRONG, should be 63008E109)

AAPL,37833100 (WRONG, should be 0 in the begin)

Problem in method get_data_frame(data_dict, field_name=False)

246 string should be deleted:

#df = df.apply(pd.to_numeric, errors='ignore')

Then result is OK. Please fix it.

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.

Upvote
Accepted
39.4k 77 11 27

@vsoloviev et all,
The data is retrieved from a RESTful Web service and is delivered as JSON. get_data function parses JSON and constructs pandas dataframe. To make numeric data ready available for calculations get_data function applies pandas to_numeric method on the dataframe. The side effect of it is that any data pandas to_numeric method can interpret as numeric is returned as float64 or int64 including what is actually intended to be a string such as CUSIPs in the example on this thread. We could remove to_numeric method from get_data function. But then users may need to implement additional code before applying calculations on the data that is meant to be numeric.
We welcome suggestions from the community on how to best handle this in the API. Do you think calling pandas to_numeric method is unnecessary or redundant? Or can you think of a better way to make the dataframe returned by get_data method ready to use?
In the meantime as an immediate workaround you can use raw_output=True parameter in get_data function, which will result in the function returning JSON instead of dataframe. You can then parse JSON as you see fit. Alternatively you could modify the code in get_data_frame function in your copy of data_grid.py (e.g. remove the line that applies to_numeric method on the dataframe).

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
17k 80 39 63

Hi @vsoloviev,

I just confirmed your findings and will report this to the Product Manager. Thanks for raising this.

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
1 0 0 2

Hello. Any news?

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.

Hi @vsoloviev

I am sorry, there is no update at the moment.

Moderators will update you again once we have any relevant information.

Upvotes
1 0 0 2

Hi Alex.

I think that it is good idea to return raw data without any transforming. Just plain raw. No need any casts.

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.