DATA170
Exploring Data

Activity 5

Numpy Arrays

  1. Without using numpy, write the Python function is_square(numbers_list) that returns True if numbers_list is a square matrix and false otherwise. Where a square matrix is a two-dimensional list of lists of numbers where every sub-list has the same length as the number of sub-lists.

  2. Using numpy and no loops, write the is_square(numbers_array) that returns True if numbers_array is square matrix. Where a square matrix is a two-dimensional ndarray.