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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 1

Exclude records with specific field values

I am trying to use codebook to extract certain data as per the code found below

from the data extracted I would like to exclude records with values other than USD in the CF_CURR field

Any idea how I can do that?

df, err = ek.get_data(

instruments = ['0#EGEUROSAZ='],

fields = ['CF_CURR']

)

display(df)

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonapicodebook
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvote
Accepted
18k 21 12 20

Hi @youssef.mourad

You can read some articles online about how to select dataframe row with column value condition.

Here is example, https://www.geeksforgeeks.org/selecting-rows-in-pandas-dataframe-based-on-conditions/


Here is the sample code for your question:


ahs.jpg (49.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea