Assuming that you only have single value for each key, you can extract a list this way.
dict_to_array = lambda x:np.array([value for _,value in x.items()]) In : labor_arr = dict_to_array(labour_cost_dict) Out: [240, 3, 400] In : final_arr = np.vstack((labour_arr, mat_arr)) In : final_arr Out: array([[240, 3, 400], [100, 13, 20]])
And then you can convert them to np array and plot the pie chart. Since its not exactly clear how you want your pie chart to be, you can plot using the example provided
CLICK HERE to find out more related problems solutions.