Very curious to learn if there is a better (faster) way to pull API data on an existing df when the 'SDate' varies by row.
I'm new to programming, so I've only figured out how to do this using a for loop.
Is there a better (faster) way to do this?
Example code below:
[1] import refinitiv.data as rd
[2] import pandas as pd
[3] rd.open_session()
[4] temp = [ ]
for row in df.iterrows():
x = rd.get_data(
universe = row[1][0],
fields = ['TR.PriceClose',
'TR.DPSActValue'],
parameters = {
'SDate': row[1][9],
}
)
temp.append(x)
Many thanks!