Hi,
Am trying to pull some data from API using following code
#####################
import eikon as ek
df_NWE_Ethylene_Spot = ek.get_timeseries([ 'PHAJD00' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_Ethylene_Spot = df_NWE_Ethylene_Spot.reset_index()
df_NWE_Ethylene_Spot = df_NWE_Ethylene_Spot.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_Ethylene_Spot['Quote Name'] = 'Ethylene'
df_NWE_Ethylene_Spot_FD = ek.get_timeseries([ 'HPAJE10' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_Ethylene_Spot_FD = df_NWE_Ethylene_Spot_FD.reset_index()
df_NWE_Ethylene_Spot_FD = df_NWE_Ethylene_Spot_FD.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_Ethylene_Spot_FD['Quote Name'] = 'Ethylene FD'
df_NWE_Propylene_Spot = ek.get_timeseries([ 'HPAJP10' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_Propylene_Spot = df_NWE_Propylene_Spot.reset_index()
df_NWE_Propylene_Spot = df_NWE_Propylene_Spot.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_Propylene_Spot['Quote Name'] = 'Propylene'
df_NWE_Propylene_Spot_FD = ek.get_timeseries([ 'HPAJQ10' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_Propylene_Spot_FD = df_NWE_Propylene_Spot_FD.reset_index()
df_NWE_Propylene_Spot_FD = df_NWE_Propylene_Spot_FD.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_Propylene_Spot_FD['Quote Name'] = 'Propylene FD'
df_NWE_Butadiene_Spot = ek.get_timeseries([ 'PHAKG00' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_Butadiene_Spot = df_NWE_Butadiene_Spot.reset_index()
df_NWE_Butadiene_Spot = df_NWE_Butadiene_Spot.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_Butadiene_Spot['Quote Name'] = 'Butadiene'
df_NWE_Benzene_Spot = ek.get_timeseries([ 'AAOAX00' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_Benzene_Spot = df_NWE_Benzene_Spot.reset_index()
df_NWE_Benzene_Spot = df_NWE_Benzene_Spot.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_Benzene_Spot['Quote Name'] = 'Benzene'
df_NWE_Toluene_Spot = ek.get_timeseries([ 'AASFD00' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_Toluene_Spot = df_NWE_Toluene_Spot.reset_index()
df_NWE_Toluene_Spot = df_NWE_Toluene_Spot.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_Toluene_Spot['Quote Name'] = 'Toluene'
df_NWE_Xylene_Spot = ek.get_timeseries([ 'AAILD00' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_Xylene_Spot = df_NWE_Xylene_Spot.reset_index()
df_NWE_Xylene_Spot = df_NWE_Xylene_Spot.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_Xylene_Spot['Quote Name'] = 'Xylene'
df_NWE_NatGas_Spot = ek.get_timeseries([ 'NGLNMc1' ],fields='CLOSE' , start_date='2015-01-01',interval='daily')
df_NWE_NatGas_Spot = df_NWE_NatGas_Spot.reset_index()
df_NWE_NatGas_Spot = df_NWE_NatGas_Spot.rename(columns = {"Date": "quote_date", "CLOSE": "value" } )
df_NWE_NatGas_Spot['Quote Name'] = 'NatGas'
###########################
every time one of the above dataframes returns as empty and the .reset_index() function fails. It is never the same dataframe, changes every time as if there is some issues with pulling those values.
Can you help fix this please?