Jacob Wilson
04/28/2021, 5:11 PMKevin Kho
Jacob Wilson
04/28/2021, 6:33 PMresults_json = get_results_json.map(id_list, unmapped(BEARER_TOKEN), unmapped(BASE_URL), unmapped(HEADERS))
results = parse_rubric_results_json(results_json)
I have two functions here. get_rubric_results
, which takes about an hour to complete, and parse_rubric_results
, which takes about 15 hours. parse_rubric_results
takes in a list of json objects, iterates through the list and picks out the specific fields we are looking for in the json, and it then appends those fields to a data frame, and finally returns the data frame in the end.Kevin Kho
Kevin Kho
Jacob Wilson
04/28/2021, 6:45 PMKevin Kho
pd.DataFrame({'col1': list1, 'col2':list2})
Kevin Kho
df1 = df1.append(df2)
inside a loop is painfully slowKevin Kho
pd.read_json
can speed up your operation as well by reading the data in at once and then doing vectorized operations on the DataFrame