Unable to get all available periods when requesting multiply time series using eikon for python.

I am currently trying to get the data for multiple time series between the year 1995 and now at a monthly level.


rics = 
['aPLCEMPO/A',
'aPLCPIB',
 'aPLNOT/C',
 'aPLHPERMCP',
 'aPLRETTOS/CA',
 'aPLUNR',
 'aPLCINDG/A',
 'aPLPPIAT/C',
 'aPLWSTOTH/C',
 'aPLCONACT',
 'aPLIMPP',
 'aPLEXPP',
 'aPLCPICXFE',
 'aPLBINTR',
 'aPLXRUSD']

eikon_df_m = ek.get_timeseries(rics, interval = 'monthly', start_date = '1995-01-01')

It returns missing data on quite a few of them where there is data and the earliest it goes back is 2006, however when requesting them individually I can get data going back as far as I want.


Basically very few of the rows below should be NA and data should go back to 1995 for quite a few of selected seris.


1678119174651.png

Best Answer

  • @sassoonj Thanks for your question and sorry to hear about your issue. So I believe you are running into get_timeseries interday limit per call of 3000 data points, To get around this please try iterating across the list of RICs as follows:

    rics = ['aPLCEMPO/A','aPLCPIB','aPLNOT/C','aPLHPERMCP','aPLRETTOS/CA','aPLUNR',
            'aPLCINDG/A','aPLPPIAT/C','aPLWSTOTH/C','aPLCONACT','aPLIMPP','aPLEXPP',
            'aPLCPICXFE','aPLBINTR','aPLXRUSD']
    data1 = pd.DataFrame()
     
    for ric in rics:
        df1 = ek.get_timeseries(ric,interval = 'monthly', start_date = '1995-01-01')
        df1.rename(columns = {'VALUE': ric}, inplace = True)
        if len(data1):
            data1 = pd.concat([data1, df1], axis=1)
        else:
            data1 = df1

    data1

    1678125449156.png

    This seems to work for me. I hope this can help.

Answers

  • Thank you, this works. Although I think there is an error in your answer. I changed

    df1.rename(columns = {'VALUE': i}, inplace = True) 
    to:
    df1.rename(columns = {'VALUE': ric}, inplace = True)
  • @sassoonj Thanks so much for the spot - apols yes - I have changed the code sample I shared.