country-related variable values ​​do not appear in all rows

allisson
allisson Newcomer
edited January 24 in Refinitiv Data Platform

Why don't country-related variable values ​​(such as TR.HeadquartersCountry or TR.ExchangeCountry) appear in every row of the DataFrame returned using rd.get_data? Country data only appears for the first observation for each company. What can I do to ensure that this information is available in every row?

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @allisson

    Thank you for reaching to us.

    I checked the Data Item Browser tool and found that those fields don't support historical data. Therefore, they will not work with the Start Date and End Date parameters.

    You can use Python code to fill empty values. For example:

    df = ld.get_data(
        universe= ['IBM.N','LSEG.L'],
        fields=['TR.PriceClose','TR.HeadquartersCountry','TR.ExchangeCountry'],
        parameters={'SDate':'2025-01-01','EDate':'2025-01-20'}
    )
    df.replace(r'^\s*$', np.nan, regex=True).fillna(method='ffill')