Ex 3.7 Groupby(): Two Columns:

Objective: Learn how to aggregate data with pandas groupby() on two columns.

  1. Create a new Jupyter Notebook file and name it Ex3.7_Groupby_TwoCol.ipynb.
  2. Work through parts 1 through 3 and submit your completed Jupyter Notebook (.ipynb) file to the first quiz question on Canvas. Your notebook should include both your code and the corresponding output that match the screengrabs provided below. Be sure to run all cells so that every output appears in the notebook.

Part 1:

  • Using the Orders worksheet in the Sample - Superstore.xlsx file, write code to create the following DataFrame.

Expected output: pandas groupby on two columns result from Sample Superstore Orders worksheet Part 1

 

Part 2:

  • Using the Orders worksheet in the Sample - Superstore.xlsx file, write code to create the following DataFrame.

Expected output: pandas groupby on two columns result from Sample Superstore Orders worksheet Part 2

 

Part 3:

  • Using the Orders worksheet in the Sample - Superstore.xlsx file, write code to create the following DataFrame.

Expected output: pandas groupby on two columns result from Sample Superstore Orders worksheet Part 3