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

Datetime from ek.get_timeseries

I have the following python fragment:

sm = ek.get_timeseries(ric, fields='Close', …..

count = sm['CLOSE'].count()

if count >= 1:

for index in range(count):

close_price = sm['CLOSE'][index]

date_time = ...?

I need to save variable date_time="Datetime". How do it.

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.

Hello @Peter.Marushchak

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

@Peter.Marushchak

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
4.6k 26 7 22

@Peter.Marushchak the timestamp is the pandas dataframe index, you can get the values by accessing it and converting it to the list

sm.index.tolist()

The way you are traversing the dataframe is also not quite conventional, I suggest you turn to pandas documentation or code samples. A better way is:

for index,row in sm.iterrows():
    print(index, row['CLOSE'])
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.