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

Number Of Analysts Historical Data

output-screenshot.pngI have list of CUSIPS for approx 7000 companies and I want to get the Number Of Analysts of these in a historic perspective over severalt years.I have tried different codes but I can't get the date/month/year in the output. How can I manage to do this?

Here's the code I have tried, it just gives the output of 12 in Period Month, I want to have the month and year as output.


fields = ['TR.CommonName', 'TR.NumberOfAnalysts.periodmonth', 'TR.NumberOfAnalysts']
df_eikon_timeseries = ek.get_data(cusips, fields, {'SDate':'2014-01-01','EDate':'2015-12-31','Frq':'M'})

See screenshot.


python api
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
Accepted
14k 30 5 10

Hi @ole.a.solberg ,

You can find the available output parameters of each field in Data Item Browser (DIB) in Eikon/workspace application

For example, below is the screenshot of the DIB app of the field TR.NumberOfAnalysts, then check the 'Output' dropdown in the 'Parameters' tab to see available parameters, I choose 'date' here.

1653482177660.png

then add 'TR.NumberOfAnalysts.date' into the field list as below

please note that ek.get_data function returns 2 outputs, which are dataframe and error message. so the syntax below assigns an output of this function to 2 variables is recommended

fields = ['TR.CommonName', 'TR.NumberOfAnalysts.date', 'TR.NumberOfAnalysts.periodmonth', 'TR.NumberOfAnalysts']
df, err = ek.get_data(['00030710','00036020'], fields, {'SDate':'2014-01-01','EDate':'2015-12-31','Frq':'M'})
display(df)

1653482304898.png



1653482177660.png (67.2 KiB)
1653482304898.png (47.3 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
1 0 0 1

@raksina.samasiri

Sorry about the late reply but I haven't had the time to look at before now. Thanks for the help. This led me to the correct solution but I ended up using the parameter 'Calc Date' instead of date.

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.