I have Eikon Commodities product, and am struggling with two issues:
- Certain fields only populate on the earliest DateTime.
- When I add certain RICS, I get an error message and the Tuple only returns a one row dataframe , in the example below I added the field “TR.AssetDestinationPortCountry” which triggered the error.
"""
PYTHON CODE BELOW
"""
#Import Libraries
import eikon as ek
import pandas as pd
import numpy as np
ek.set_app_key('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
#Extract HistAll
tupHistAll = ek.get_data(["9498298"],["TR.AssetName;\
TR.AssetDateTime;\
TR.AssetDestination;\
TR.AssetDestinationPort;\
TR.AssetDestinationZone;\
TR.AssetDWT;\
TR.AssetFlowCommodity;\
TR.AssetDraught;\
TR.AssetETA;"\
],\
{'SDate': '06Jun22', 'EDate': '14Jun22', 'RH': 'In'})
dfVesselHistAllTest = pd.DataFrame(tupHistAll[0]).iloc[:,1:]
dfVesselHistAllErr = pd.DataFrame(tupHistAll[1]).iloc[:,1:]
#Extract HistDaily
tupHistDaily = ek.get_data(["9498298"],[
"TR.AssetName;\
TR.AssetDateTime;\
TR.AssetDestination;\
TR.AssetDestinationPort;\
TR.AssetDestinationZone;\
TR.AssetDWT;\
TR.AssetFlowCommodity;\
TR.AssetDraught;\
TR.AssetETA;\
"],\
{'SDate': '07Oct20', 'EDate': '15Oct20', 'RH': 'In',\
'VDT':'True'})
dfVesselHistDaily = pd.DataFrame(tupHistDaily [0]).iloc[:,1:]
dfVesselHistDailyErr = pd.DataFrame(tupHistDaily [1]).iloc[:,1:]
#Extract HistAll
tupHistAll2 = ek.get_data(["9498298"],["TR.AssetName;\
TR.AssetDateTime;\
TR.AssetDestination;\
TR.AssetDestinationPort;\
TR.AssetDestinationPortCountry;\
TR.AssetDestinationZone;\
TR.AssetDWT;\
TR.AssetFlowCommodity;\
TR.AssetDraught;\
TR.AssetETA;"\
],\
{'SDate': '06Jun22', 'EDate': '14Jun22', 'RH': 'In'})
dfVesselHistAllTest2 = pd.DataFrame(tupHistAll2[0]).iloc[:,1:]
dfVesselHistAllErr2 = pd.DataFrame(tupHistAll2[1]).iloc[:,1:]
#Extract HistDaily
tupHistDaily2 = ek.get_data(["9498298"],[
"TR.AssetName;\
TR.AssetDateTime;\
TR.AssetDestination;\
TR.AssetDestinationPort;\
TR.AssetDestinationPortCountry;\
TR.AssetDestinationZone;\
TR.AssetDWT;\
TR.AssetFlowCommodity;\
TR.AssetDraught;\
TR.AssetETA;\
"],\
{'SDate': '07Oct20', 'EDate': '15Oct20', 'RH': 'In',\
'VDT':'True'})
dfVesselHistDaily2 = pd.DataFrame(tupHistDaily2[0]).iloc[:,1:]
dfVesselHistDailyErr2 = pd.DataFrame(tupHistDaily2[1]).iloc[:,1:]