currently i working with python Dataframes. I am just a beginner and i created a for loop to collect the data from api (json format)and appending it to list by join a string to the list based on each search. finally converting it to Dataframe.
This loop works perfectly fine.Since it has to loop over 1500 enteries, its taking really lot of time. can anyone suggest me best python way to make it fast .?
Thank you very much in advance :)
url = "https:\\api."
team = [abc,def,ghi, ...] # List of more than 1500 entries movie symbols
abcd = list()
for t in team:
status_url = requests.get(f"{url}/{t}")
status_data = status_url.text
status_data_list = list(status_data)
status_data_list.insert(1, f"\"Movie_name\":\"{t}\",")
final_string = ''.join(status_data_list)
parsed = json.loads(final_string)
abcd.append(parsed)
Movie_dataframe = pd.DataFrame(abcd)