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
242 3 4 2

Get cumulative abnormal returns

I need to estimate CAR for a bunch of bonds issuers, so I am starting by getting their closing price. I am unable to resample with a single index and get the data on different columns.

bonds, err = ek.get_data(
    df['Ultimate Parent ID'],
    ['TR.PriceClose.date', 'TR.PriceClose'],
    {'SDate': '2020-01-01',
     'EDate': '2020-10-01'})

What I get is:

I would prefer to get a single timeseries with a column for each instrument, but I am unable to rearrange the df. Should I use ek.get_timeseries instead?


eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apitime-seriespricing
capture.png (12.0 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.

1 Answer

· Write an Answer
Upvote
Accepted
18.2k 21 13 21

Hi @lorenzo.cerreta

You can use pivot() and transpose() functions from dataframe.

Here is an example:


ahs.png (40.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.

Thanks for the great answer!

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.