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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
242 1 3 1

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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythontime-seriespricing
capture.png (12.0 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.

1 Answer

Upvote
Accepted
18k 21 12 20

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 5.0 MiB each and 10.0 MiB total.

Thanks for the great answer!

Click below to post an Idea Post Idea