Challenge: Practice More Methods from the NumPy Library

Write code to find indices of nonzero elements, create an identity matrix, find the minimum and maximum values, and create a matrix as a chess board pattern.

Write a program to achieve the following tasks:

  1. Find indices of nonzero elements from [11, 22, 0, 0, 40, 50, 0].
  2. Create a 5 x 5 identity matrix.
  3. Create a 4 x 4 array with random values and find the minimum and maximum values.
  4. Create an 8 x 8 array and fill it with a chess board pattern.

Get hands-on with 1200+ tech skills courses.