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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 2

get_timeseries returns full DataFrame when queried for holidays

Hello,

First of all, thanks a lot for this API that is helping us a lot in our daily work.

We are using the get_timeseries to retrieve historical closing prices for different products, and we stumbled upon a weird behaviour.

When we query the method with a start_date and end_date which are holidays (week-ends or official closed days), we get a lot of results instead of an empty Dataframe.

For example :

> python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import eikon as ek
>>> import datetime as dt
>>> ek.set_app_id('TRUNCATED')
>>> ek.get_timeseries('UEN.L', start_date=dt.datetime(year=2017,month=1,day=1), end_date=dt.datetime(year=2017,month=1,day=2))
UEN.L          HIGH      LOW   CLOSE    OPEN  COUNT     VOLUME
Date
2006-02-21  7750.00  7700.00  7700.0  7750.0   -1.0   10551.30
2006-02-22  7700.00  7400.00  7550.0  7700.0   -1.0   10163.20
2006-02-23  7550.00  7550.00  7550.0  7550.0   -1.0    2772.00
2006-02-24  7550.00  7550.00  7550.0  7550.0   -1.0     908.55
2006-02-27  7800.00  7550.00  7800.0  7550.0   -1.0    5851.05
[...]
2018-01-03    60.00    58.20    60.0    60.0    2.0    7600.00
2018-01-04      NaN      NaN     NaN    60.0   -1.0        NaN

As you can see, we receive a full DataFrame of 3000 rows, which I guess is the max results you can provide in one call.

Changing the end_date with a date that is not a holiday gives us the expected result :

>>> ek.get_timeseries('UEN.L', start_date=dt.datetime(year=2017,month=1,day=1), end_date=dt.datetime(year=2017,month=1,day=3))
UEN.L        HIGH   LOW  CLOSE  OPEN  COUNT   VOLUME
Date
2017-01-03  73.88  64.0   67.5  65.0    7.0  12893.3

Doing the same calls with strings instead of datetime gives the same results.

Is it an expected behaviour on your side ?


Thanks in advance,


Grégoire Bärtschi

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.

Upvotes
Accepted
4.6k 26 7 22

Hi Gregoire! This is a bug with an underlying time series service, thanks for reporting it.

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.

Hi @Zhenya Kovalyov, Hi @loic.guezennec,

In case you did not notice it yet, this issue has been fixed in the Eikon time series service in May 2018.

Olivie

Upvotes
1 0 0 0

Hi @Zhenya Kovalyov, I think I ran into a similar issue: when querying for time ranges when the series has no data, an entire time series is returned:

>>> df = ek.get_timeseries(['ROGV1YDP=SM'], ['VALUE'], start_date='1980-01-01', end_date='1980-01-10')
>>> df.head()
ROGV1YDP=SM      VALUE
Date                  
2010-01-31    4.794667
2010-02-28    4.959043
2010-03-31   14.834607
2010-04-30   12.778536
2010-05-31   12.649895
>>> df.tail()
ROGV1YDP=SM     VALUE
Date                 
2018-01-19   0.887557
2018-01-22   0.887162
2018-01-23   0.887162
2018-01-24   0.838863
2018-01-25   0.838449

Do you have a timeline when this bug will be fixed? It would be much appreciated!

Thanks,
Algirdas

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
4.3k 2 4 5

I just tested again both examples and it seems that the issue was fixed.

First example:

>>> import eikon as ek
>>> ek.set_app_key(‘xxxxxxxxxxxxxxxxx’)
>>> import datetime as dt
>>> ts=ek.get_timeseries('UEN.L', start_date=dt.datetime(year=2017,month=1,day=1), end_date=dt.datetime(year=2017,month=1,day=2))
Error with UEN.L: No data available for the requested date range
UEN.L: No data available for the requested date range |
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python36\lib\site-packages\eikon\time_series.py", line 184, in
get_timeseries
    raise EikonError('Error', message=ts_error_messages)
eikon.eikonError.EikonError: 'Error code Error | UEN.L: No data available for the requested date range |  '

Second example:

>>> df = ek.get_timeseries(['ROGV1YDP=SM'], ['VALUE'], start_date='1980-01-01', end_date='1980-01-10')
Error with ROGV1YDP=SM: No data available for the requested date range
ROGV1YDP=SM: No data available for the requested date range |
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python36\lib\site-packages\eikon\time_series.py", line 184, in
get_timeseries
    raise EikonError('Error', message=ts_error_messages)
eikon.eikonError.EikonError: 'Error code Error | ROGV1YDP=SM: No data available for the requested date range |  '
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