I tried to get some data using lseg-data 2.0.1 with "fundamental_and_reference".
The result obviously contains some <NA> values.
I got the message:
"FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True)"
This is my program:
asofdate = "2024-12-13"
asofdate = str(asofdate)
curn = "EUR"
constituents1_list = ["AAK.ST","AALB.AS", "WTB.L", "ZALG.DE", "ZURN.S"]
retr_fields = ['TR.CommonName', 'TR.TotalAssetsReported(Period=FY0,scale=6,IncludePartial=No)', 'TR.LTInvestments(Period=FY0,scale=6,IncludePartial=No)', 'TR.STInvestments(Period=FY0,scale=6,IncludePartial=No)']
# assign the values for the retrieval parameters
retr_param = {'SDate':f'{asofdate}', 'curn':f'{curn}'}
### open the session
ld.open_session(name='platform.ldp')
print("*** LSEG-Session opened ...")
response = fundamental_and_reference.Definition( universe=constituents1_list, fields=retr_fields, parameters=retr_param).get_data()
universe1 = response.data.df
print("universe1:")
print(universe1)
And this is the result:
What can I do in order to avoid the FutureWarning and use correct code?