Sparse Matrix Program In Python