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

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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-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.

Upvote
Accepted
18.2k 21 13 21

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 512.0 KiB each and 1.0 MiB total.

Upvotes
78.1k 246 52 72

@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 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.