December 2017
Intermediate to advanced
386 pages
10h 42m
English
Lets get into the details.
from scipy.sparse import lil_matrixfrom scipy.sparse.linalgimport spsolvefrom numpy.linalg import solve, normfrom numpy.random import rand
A = lil_matrix((10000, 10000))
In the preceding snippet of code, we have initialized a linked list matrix that is 10,000 x 10,000 in size.
A[0, :100] = rand(100)A[1, 100:200] = A[0, :100]
In the preceding snippet of code, we have imputed the first 100 columns of the first row of the matrix, and the next 100 columns of the second row of the matrix with random numbers.
A.setdiag(rand(10000))
In the preceding set of code, ...
Read now
Unlock full access