I am trying to parallelize a simple python loop using Jupyter Notebook. I tried to use Pool but it just hangs forever and I have to kill the notebook to stop it.
def process_frame(f):
new_dict = dict()
pc_dict = calculate_area(fl)
for key in pc_dict:
if key not in new_dict:
new_dict[key] = 0
new_dict[key] = float(sum(pc_dict[key]))
full_pc_dict[fl] = new_dict
frames_list = [0, 1, 2, 3, 4, 5, 6]
I want to process_frame for each frame in the frames_list.
Note that the final outcome should be a dict with all the outputs from process_frame. I don't know if appending it at the end of the function may be a good idea.
Any suggestion on how to do this using Jupyter Notebook? Also, is it possible to have tqdm working with this parallel processing?
Kind regards