1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to NumPy

Connected

Exercise

2D split and stack

Splitting and stacking skills aren't just useful with 3D RGB arrays: they are excellent for subsetting and organizing data of any type and dimension!

You'll now take a quick trip down memory lane to reorganize the monthly_sales array as a 3D array. Recall that the first dimension of monthly_sales is rows of a single month's sales across three industries, and the second dimension is columns of monthly sales data for a single industry.

Your task is to split this data into quarterly sales data and stack the quarterly sales data so that the new third dimension represents the four 2D arrays of quarterly sales.numpy is loaded as np, and the monthly_sales array is available.

Instructions 1/2

undefined XP
    1
    2
  • Split monthly_sales into four arrays representing quarterly data across industries; print q1_sales.