question

Upvotes
29 1 1 4

Different execution result between codebook and python API

Good morning,


I'm using the refintiv.data api to query some bond data.


In the codebook I'm running

rd.discovery.search(
        filter = f"RIC eq '458140BP4=RRPS'",
        select = "MaturityDate"
    )

this runs without issues and gives me the maturity date.


However when i copy paste the same thing in my code editor, i get

ValueError                                Traceback (most recent call last)
<ipython-input-6-2b09bc2fc4a2> in <module>
----> 1 rd.discovery.search(
      2         filter = f"RIC eq '458140BP4=RRPS'",
      3         select="MaturityDate"
      4     )                                                                                                   ValueError: Could not convert object to NumPy datetime

I've been using the API in my code editor for quite some time now, so I know my setup is correct, but i cant understand why the results are different here.


Does anyone have any idea?

python#technologysearchcodebook
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
85k 289 53 77

@adam.leroux

Thank you for reaching out to us.

The versions of the Python dependency libraries, such as Pandas and Numpy, may be different.

You can check the CodeBook Libraries and Extensions via the following menu.

1725612196782.png



1725612196782.png (25.4 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.

Upvotes
27.2k 65 17 14

Hello @adam.leroux

I did a quick test on my environment. It works fine with Data Library 1.6.2, NumPy 1.26.4 and Pandas 2.2.2.

result.png


result.png (32.7 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.

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.