Dear students,
The scores of the first graded exercise have been uploaded to Moodle. We also provide a solution here.
You performed well, with an average mark of 83.9/100.
Some common issues that we found are:
- len(matrix) and matrix.shape are not equivalent:
import numpy as np
a = np.zeros((10, 5))
print(len(a)) # number of rows
# 10
print(a.size) # total number of parameters
# 50
print(np.prod(a.shape)) # number of rows * columns
# 50
- Please avoid leaving long debug prints in your submission.
- Avoid naming variables with python reserved expressions like "len" or "sum".
Best regards,
Benoit