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
3 0 0 0

FutureWarning for data_grid.py (pandas.np module is deprecated and will be removed... import numpy directly instead) when using Eikon Python API

Hi,

I see a warning when using Eikon's Python API package (eikon). The commands I ran were:

  1. import eikon as ek
  2. ek.set_app_key('....')
  3. df2, err = ek.get_data(['RIC_1', 'RIC_2' ...], ['TRD_STATUS'])

The warning message I see is:

C:\Users\kengwong\KOminiconda3\envs\brk\lib\site-packages\eikon\data_grid.py:247: FutureWarning: The pandas.np module is deprecated and will be removed from pandas in a future version. Import numpy directly instead
  data = pd.np.array([[get_data_value(value) for value in row] for row in data_dict['data']])

This is not an error, it looks more like a warning.

Cheers,
Keng Onn

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apipandasdeprecated
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.

Hello! @

Is there an update to this, please? The pandas.np submodule will be deprecated and we will not be able to run get_data() requests unless they are changed.

Here're the versions of Python, pandas and eikon that I'm using:

  • Python: 3.6.8
  • eikon: 1.1.2
  • pandas: 1.0.1

Contacted Olivier Davant.

Hello @Keng Onn,

Thank you for bringing this issue to our attention.

Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

Thanks, yes, your reply is fine. I've clicked "Accept". Thanks!

1 Answer

· Write an Answer
Upvotes
Accepted
78.8k 250 52 74

@Keng Onn

Thank you so much for the information.

Refer to Pandas: What’s new in 1.0.0 (January 29, 2020), it indicates that the pandas.np submodule is now deprecated.

However, Eikon Data APIs python still uses pd.np. Eikon Data APIs library requires pandas>=0.17.0.

I will report this problem to the product team for consideration.


1587623684550.png (57.9 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.

Hello! @

Is there an update to this, please? The pandas.np submodule will be deprecated and we will not be able to run get_data() requests unless they are changed.

@alex.yermolayev

There is no update from the product team.

However, from my testing, the data can be retrieved properly although it reports the warning messages.

Otherwise, you may need to use pandas < 1.0.0 instead.

1589341511612.png (31.0 KiB)

Pandas is now using SemVer so pd.np should be available through pandas 2.0.0 without code breakage (deprecations introduced in the 1.x series will no longer be removed until 2.x). Realistically it will probably last at least a year.


That said, referencing pd.np was never good design practice. Pandas's internal import of numpy accidentally made it into the public pandas namespace but wasn't supposed to be used. This should be fixed in the eikon code to import numpy as np directly.

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.