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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
25 4 4 8

Eikon API - AttributeError: 'DataFrame' object has no attribute 'convert_dtypes' - on simple ek.get_data call

I have successfully installed Refinitiv Workspace, and have successfully gotten the excel add in to work. All good.

Having a problem with the python API. Can you give this to your python guys? Basically, here is the call I am doing, which is returning an error:

df, e = ek.get_data('AAPL.OQ',
                    ['TR.Employees.fperiod',
                     'TR.Employees',
                     'TR.PartTimeEmployees',
                     'TR.TotAssetsEmployees',
                     'TR.RevenueperEmployeescalYrEnd',
                     'TR.ROCESmartEst'],
                    {'Period': 'FY0', 'Frq': 'FY', 'SDate': 0, 'EDate': '-1'})

I get the following error:

AttributeError: 'DataFrame' object has no attribute 'convert_dtypes'


I am using python 3.7, and the python eikon pkg version 1.1.7.

eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonapipandas
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.

1 Answer

Upvote
Accepted
39.3k 76 11 27

@lgreen

Which version of pandas do you have installed? The method convert_dtypes was introduced into pandas v1.0.0. The AttributeError exception due to this method not recognized suggests you have an earlier version of pandas library. You can check by running

import pandas as pd
pd.__version__

As listed in the package dependencies, Eikon Data APIs library for Python v1.1.7 requires pandas v1.0.0 or higher.

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.

that did it! updated and all set now. thx