import refinitiv.dataplatform.eikon as ek
import numpy as np # NumPy
import pandas as pd # pandas
import configparser as cp
import sys
ek.set_app_key('') # here I insert app_key
import eikon as ek
df_xls = pd.read_excel(r'C:\10K.xlsx')
mylist = df_xls['RIC'].tolist()
#print(mylist)
df, err = ek.get_data(
instruments = mylist,
fields = ['MEDIAN(TR.PtoEPSMeanEst(Period=NTM,Frq=W,SDate=2016-12-15,EDate=2021-12-14))']
)
display(df)
Below you could see the result of the script: