Exercise

Plotting the task graph

You are trying to analyze your company's spending records. Your manager wants to see what fraction of the total spending occurred in each month. But you are going to have to run it for many files, so it would be good to set up a lazy calculation so you can speed it up using threads or processes. To figure out which of these task scheduling methods might be better for this calculation, you would like to visualize the task graph.

The totals spent in two months are available for you as delayed objects as month_1_costs and month_2_costs. dask has also been imported for you.

Instructions

100 XP
  • Calculate the total spend from the two months.
  • Find the fraction of the total which was spent in the first month.
  • Find the fraction of the total which was spent in the second month.
  • Visualize the joint task graph used to compute month_1_fraction and month_2_fraction.