Date Field contains indexed numbers

carruiz
carruiz Newcomer
edited March 14 in Eikon Data APIs

Hi,

I am using the following script to download tresury yields.


TESOROS = ['US2YT=RR','US3YT=RR','US5YT=RR','US7YT=RR','US10YT=RR','US30YT=RR']

start_date = "2000-12-12"
end_date = "2024-12-31"

ts_tesoros,e1 = ek.get_data(TESOROS,
["TR.MIDYIELD.date","TR.MIDYIELD"],
{'SDate':start_date,'EDate':end_date,'Frq':'D'})

UST10Y = ts_tesoros.loc[ts_tesoros['Instrument']=='US10YT=RR']

When I look at the DataFrame it seems normal

UST.jpg

However, when I look at the column date it also contains some indexed numbers

Date.jpg

I only need the Date.

It was working a few days ago, but now has changed.

Anything I can do to solve this?

Thanks

Tagged:

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @carruiz

    Thank you for reaching out to us.

    This is an expected behavior of dataframe.

    If you would like to get only dates, you can use the following code.

    UST10Y["Date"].tolist()
    
    image.png
  • carruiz
    carruiz Newcomer

    Hi @Jirapongse , thanks for your answer.

    The thing is that this happens with all fields in the DataFrame and it wasn't like that a few weeks ago. Did you make some changes and I need to update my version of the python library used to download those?

    The thing is that I build a lot of python code based on the previous version and it would be difficult to go through all the code to correct each field I am using.

    Thanks.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @carruiz

    The Eikon Data API hasn't been updated since 2023.

    image.png

    As far as I know, the dataframe typically has an index.

    I think the display of the dataframe should not relate to the Eikon Data API.