I initialize an empty sparse matrix using
S = scipy.sparse.lil_matrix((n,n),dtype=int)
As expected print S
doesn't show anything, since nothing has been assigned.
Yet if I test:
print S[0,0]==0
I receive true
.
Is there a way to test if a value has been set before? E.g. along the lines of ifempty
?