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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
4 0 1 1

How to workaround problem with different timeseries?

When I query:

df = ek.get_timeseries(["LP40214720", "BCEI.N"],
                       start_date="1900-01-01")

I get an error withing pandas multi-index.

ValueError: Length mismatch: Expected axis has 1 elements, new values have 6 elements.

It is a bad idea to assume that data frames have the same fields (moreover have the same number of fields).

The workaround is to change Eikon time_series.py line number 315:

columns = [(ric_name, f) for f in fields]

with

columns = [(ric_name, f) for f in df.columns]

Now the code works just fine. Also, multi-index is working as should (when you select the first security from df only one column appears when the second six columns appear.). But be aware when dealing with securities with different past length (a NaN appears).

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
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.

Upvote
Accepted
18k 21 12 20

Hi @mzeman

Thanks for sharing and provided a workaround.

I can confirm that I can reproduce the same issue with yours.


This is output on each RIC code:


This is an issue when mixed these 2 RIC codes:


I have raised this issue to product support group.

Thanks and have a good day !


ahs1.png (21.0 KiB)
ahs2.png (92.9 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.

Upvotes
38.1k 69 35 53

@mzeman

I have checked with the latest version of Eikon Data API (1.1.4). The problem has bee solved.



1597894291792.png (68.1 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