Exercises (lab01)

1.5. Exercises (lab01)#

This ungraded assignment is composed of 26 NumPy exercises divided in three difficulty levels: beginner, intermediate, and advanced. In order to understand and solve the exercises, and more generally to gain the maximum benefit from this tutorial, it is highly recommended that you read Chapter 1 of the course notes available on Blackboard.

1.5.1. Contents#

Part 1. Beginner level

Exercise

Topic

Quiz 1.1

Array creation I

Quiz 1.2

Array creation II

Quiz 1.3

Attribute .shape

Quiz 1.4

Reshaping

Quiz 1.5

Vectorization I

Quiz 1.6

Vectorization II

Quiz 1.7

Keyword axis

Quiz 1.8

Simple indexing

Quiz 1.9

Slicing

Part 2. Intermediate level

Exercise

Topic

Quiz 2.1

Creation

Quiz 2.2

Slicing I

Quiz 2.3

Slicing II

Quiz 2.4

Reshaping I

Quiz 2.5

Reshaping II

Quiz 2.6

Reshaping III

Quiz 2.7

Indexing

Quiz 2.8

Broadcasting

Quiz 2.9

Scalar product

Part 3. Advanced level

Exercise

Topic

Quiz 3.1

Checkboard

Quiz 3.2

Column swapping

Quiz 3.3

Find minimum

Quiz 3.4

Sum pairs of cols

Quiz 3.5

Softmax

Quiz 3.6

Linear regression

Quiz 3.7

Pairwise distances

Quiz 3.8

Advanced indexing

1.5.2. Required packages#

For this assignment, you need to import the following packages.

  • Numpy - The fundamental package for scientific computing with Python.