Dear QuantEcon Team,
My comment refers to https://lectures.quantecon.org/py/orth_proj.html - the site on “Tools and Techniques: Orthogonal Projections and Their Applications”.
Your solution to Ex. 3 should be slightly tweaked, in my opinion: in order to use
n, k = X.shape in the set-up, X ought to be an array. However, you declare
X = [[1, 0], [0, -6], [2, 2]] further down in the solutions. It should be
X = np.array([ [1, 0], [0, -6], [2, 2] ]) instead for the code to work well, I believe. Please, correct me if I missed anything.