Hi - The following code correctly populates RIC ULSDCALMc1, c2 ... , c15 except c4 for the period 10/29/21-onwards. Could you pls investigate?
NumRics = 16 today = date.today().strftime('%Y-%m-%d') contract = 'ULSDCALMc' riclist = ["{}{}".format(contract, i) for i in range(1, NumRics, 1)] df30 = ek.get_timeseries(riclist, 'close', start_date='2017-01-01', end_date=today, interval='weekly') df30['Date1'] = df30.index df30_unpivot = pd.melt(df30, id_vars=['Date1'], value_vars=riclist) df30_unpivot = df30_unpivot.rename(columns={ 'CLOSE': 'RICName', 'value': 'RICValue'}) df30_unpivot.to_csv(pricespath + "ULSDCALM_melt_frek.csv") df30.reset_index('Date', inplace=True) # df30 = df30.interpolate(method='linear') df30.to_csv(pricespath + "ULSDCALM_frek_test.csv")