1. Learn
  2. /
  3. Courses
  4. /
  5. Interactive Data Visualization with Bokeh

Exercise

Creating nested categories

For your final plot, the estate agents would like you to present property sales across the year, displaying months and quarters on the x-axis.

Some of the code to add months and quarters into the Melbourne dataset has been preloaded for you. The factors variable, which will represent months and their corresponding quarters, needs to be created. The data must be also grouped by these two newly created columns to calculate total sales by taking the sum of the "price" column.

Instructions

100 XP
  • Complete factors, entering the relevant quarters and associated months.
  • Create grouped_melb by grouping melb by "month" and "quarter", calculating the total of the "price" column.