I have an empty dataframe and I want to loop over an API call and input data into it based on the stock symbol in my spreadsheet.
final_dataframe = final_dataframe.append(
pd.Series(
[
symbol,
data[symbol]['price'],
data[symbol]['stats']['year1ChangePercent'],
'N/A'
],
index = my_columns),
ignore_index = True
)
As above, I currently use the append method to add the data to my dataframe, but as append is depreciating in pandas 1.4.0, I want to know how to re write the above using concat. I current have this but it does not work:
final_dataframe = pd.concat([final_dataframe,
pd.Series(
[
symbol,
data[symbol]['price'],
data[symbol]['stats']['year1ChangePercent'],
'N/A'
],
index = my_columns),
ignore_index = True
])