Construct a sparse matrix, P, corresponding to the state-transition matrix PP. Use SciPy's scipy.sparse.coo_matrix() function to construct this matrix. The dimension of the matrix should be n_airports by n_airports. If an airport does not have any outgoing segments in the data, it should appear as a row of zeroes. Note 0: You are asked to construct the matrix PP as explained in the accompanying videos. Later, when you apply this matrix, you will apply PTPT (e.g., P.T in Scipy if P is the Scipy sparse matrix object). Note 1: The calling convention for coo_matrix() can be a bit confusing. Pay careful attention to the documentation.

Solved
Show answers

Ask an AI advisor a question