How could I adjust the code (Python Eikon data API) in order to have dates as well (not only data)?

df, err = ek.get_data(

instruments = ['PFE'],

fields = ['TR.TotalAssetsReported(Period=FY0,Frq=D,SDate=2018-01-01,EDate=2021-10-15,Scale=6)']

)


display(df)

Best Answer

  • @susskaya.anita just add a .date output type - the default is value:

    df, err = ek.get_data(instruments = ['PFE'],fields =['TR.TotalAssetsReported(Period=FY0,Frq=D,SDate=2018-01-01,EDate=2021-10-15,Scale=6).date','TR.TotalAssetsReported(Period=FY0,Frq=D,SDate=2018-01-01,EDate=2021-10-15,Scale=6)'])


    display(df)

    1634314802931.png

    I hope this can help.