Skip to content
Advertisement

Tag: sparse-matrix

Import large .tiff file as sparse matrix

I have a large .tiff file (4.4gB, 79530 x 54980 values) with 1 band. Since only 16% of the values are valid, I was thinking it’s better to import the file as sparse matrix, to save RAM. When I first open it as np.array and then transform it into a sparse matrix using csr_matrix(), my kernel already crashes. See code

Initialize high dimensional sparse matrix

I want to initialize 300,000 x 300,0000 sparse matrix using sklearn, but it requires memory as if it was not sparse: it gives the error: which is the same error as if I initialize using numpy: Even when I go to a very low density, it reproduces the error: Is there a more memory-efficient way to create such a sparse

Advertisement