here is my original for loop that i am limiting to only 50 Rics and still not getting the correct data set.
API_Key = ek.set_app_key('hidden')
fields=['Timestamp','Value']
start1 = (date.today()-timedelta(days=20*365)).strftime('2020-01-01')
end1 = date.today().strftime('%Y-%m-%d')
rng = pd.date_range(start= start1 ,end=end1 ,freq='D')
Calendar= pd.DataFrame({ 'Date': rng})
TR1_50_Rics=["TD-ABM-CPT","TD-ABM-DUR","TD-ABM-HOU","TD-ABM-INC","TD-ABM-JGA","TD-ABM-LAV","TD-ABM-LIT","TD-ABM-PHL","TD-ABM-RDM","TD-ABM-SIN","TD-ABM-FAW","TD-ABM-FAW2","TD-ABM-FAW3","TD-ABM-LIV","TD-ABM-LIV2","TD-ABM-LIV3","TD-ABM-RDM2","TD-ABM-RDM3","TD-ABM-VNT","TD-ABM-VNT2","TD-ABM-VNT3","TD-ABM-TLL","TD-ABM-TLL2","TD-ABM-TLL3","TD-ABM-BRB","TD-ABM-AUG","TD-ABM-AUG2","TD-ABM-AUG3","TD-ABM-LAV2","TD-ABM-CHI","TD-ABM-CHI2","TD-ABM-CHI3","TD-ABM-KIK","TD-ABM-KIK2","TD-ABM-KIK3","TD-ABM-YPG","TD-ABM-YPG2","TD-ABM-YPG3","TD-ABM-NGB","TD-ABM-NGB2","TD-ABM-NGB3","TD-ABM-TNJ","TD-ABM-TNJ2","TD-ABM-TNJ3","TD-ABM-SIN2","TD-ABM-SIN3","TD-ABM-SRI","TD-ABM-SRI2","TD-ABM-SRI3","TD-ABM-MTP"]
Transport_df_1 = []
for TR1_50_Ric in TR1_50_Rics:
Temp_Prod_df_1 = ek.get_timeseries(TR1_50_Rics,
fields,
start1,
end1,
normalize=True)
Temp_Prod_df_1= Calendar.merge(Temp_Prod_df_1,on='Date',how='left')
Temp_Prod_df_1['Weekday'] = Temp_Prod_df_1.apply(lambda x :x.Date.weekday(), axis=1)
Temp_Prod_df_1= Temp_Prod_df_1.rename(columns={'Security' : 'EIKON_RIC','Value' : 'Close'})
Temp_Prod_df_1 = Temp_Prod_df_1[['Date', 'EIKON_RIC','Close','Weekday']]
Temp_Prod_df_1['Close'] = Temp_Prod_df_1.Close[Temp_Prod_df_1.Weekday <= 5].fillna(method='pad')
Temp_Prod_df_1['Close'] = Temp_Prod_df_1.Close[~Temp_Prod_df_1.Weekday <= 5].fillna(method='bfill')
Temp_Prod_df_1['EIKON_RIC'] = Temp_Prod_df_1.EIKON_RIC[Temp_Prod_df_1.Weekday <= 5].fillna(method='pad')
Temp_Prod_df_1['EIKON_RIC'] = Temp_Prod_df_1.EIKON_RIC[~Temp_Prod_df_1.Weekday <= 5].fillna(method='bfill')
Transport_df_1.append(Temp_Prod_df_1)
Final_Transport_df = pd.concat(Transport_df_1)
Final_Transport_df= Final_Transport_df[['Date', 'EIKON_RIC','Close']]
Final_Transport_df=Final_Transport_df.drop_duplicates().dropna()
Here is my test to see if the data is coming back correctly.
xx = ek.get_timeseries(["TD-ABM-CPT","TD-ABM-DUR","TD-ABM-HOU","TD-ABM-INC","TD-ABM-JGA","TD-RDM2-SIN"],
fields,
start1,
end1,
normalize=True)
Thank you.