Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by gabriel.g · Nov 28, 2019 at 04:24 AM · eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonerror

ValueError when retrieving timeseries

When I try to request timeseries via ek.get_timeseries a ValueError is thrown (only for specific stocks/parameters).


Example snippet with traceback:

>>> ek.get_timeseries(rics=['GHG.BH'], fields=['OPEN', 'CLOSE'], count=5)
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pandas\core\internals\managers.py", line 1677, in create_block_manager_from_blocks
    make_block(values=blocks[0], placement=slice(0, len(axes[0])))
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pandas\core\internals\blocks.py", line 3265, in make_block
    return klass(values, ndim=ndim, placement=placement)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pandas\core\internals\blocks.py", line 128, in __init__
    "{mgr}".format(val=len(self.values), mgr=len(self.mgr_locs))
ValueError: Wrong number of items passed 1, placement implies 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\eikon\time_series.py", line 206, in get_timeseries
    data_frame = NiceDataFrame_Formatter(ts_result).get_data_frame()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\eikon\time_series.py", line 257, in get_data_frame
    data_frames, rics, fields = self._get_frame_list()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\eikon\time_series.py", line 290, in _get_frame_list
    df = pd.DataFrame(datapoints, columns=fields)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pandas\core\frame.py", line 439, in __init__
    mgr = init_ndarray(data, index, columns, dtype=dtype, copy=copy)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pandas\core\internals\construction.py", line 213, in init_ndarray
    return create_block_manager_from_blocks(block_values, [columns, index])
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pandas\core\internals\managers.py", line 1687, in create_block_manager_from_blocks
    construction_error(tot_items, blocks[0].shape[1:], axes, e)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pandas\core\internals\managers.py", line 1716, in construction_error
    raise ValueError("Empty data passed with indices specified.")
ValueError: Empty data passed with indices specified.


It seems like the reason for the error is that there are no up-to-date quotes (latest GHG.BH quote is from 2019-11-04) and the number of returned rows is limited via the count param.

The ValueError is also thrown when data for multiple rics is requested, so one 'bad' ric that has no current quotes crashes the whole batch-query. I am pretty sure that this behaviour is not intended and that it should be fixed.

I've tested it on eikon version 1.0.1 and pre-release 1.1.2b0. If necessary I can provide additional examples (e.g. other rics that cause the same behaviour).


People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by chavalit · Nov 28, 2019 at 07:27 AM

Hi @gabriel.g

Thanks for reporting this.

I can reproduce the same error.


I cannot confirm if this is an intended behavior but I will inform product manager to be aware of this issue.


ahs.png (60.9 KiB)
Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
pimchaya.wongrukun01 ♦♦ · Dec 27, 2019 at 07:25 AM 0
Share

In the case for this issue, solution is Eikon Python Dev released the fix server-side

avatar image
Answer by gabriel.g · Nov 28, 2019 at 04:08 PM

Great, thank you!

As already mentioned it's mainly a problem when requesting quotes for a bunch of rics at once.
The ValueError gives no insight on which instrument caused the error, so I have to sequentially send a request for every single ric to find the culprit.

I'll probably write some kind of binary-search algorithm to circumvent it, but I'd still appreciate if you informed me on any news on this issue (e.g. by posting another reply into this thread).

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

Incorrect pandas dependency in python eikon data api

error line 151 data_grid.py

How do I fix this error with data field 'TR.RNSARPctOSPostTrans'?

CodeBook App not loading notebook environment (Spawn failed: Timeout)

Error code 429 | Client Error: Too Many Requests - Too many requests, please try again later

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • FX Venues
    • FX Trading – RFQ Maker
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • Yield Book Analytics
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges