Computational Thinking, Linear Algebra, Python, Jupyter Notebook, Math.
for large k? This is inspiration for the power method. def show_ex(v): print(', '.join(names[i].decode() for i in np.abs(v.squeeze()).argsort()[-1:-10:-1])) ?np.squeeze How to normalize a sparse matrix: S = sparse.csr_matrix(np.array([[1,2],[3,4]])) Sr = S.sum(axis=0).A1; Sr array([4, 6],