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

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.

Best Answer

  • @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.

Answers