Matlab reshape10/12/2023 Transposition is very cheap, but there is no efficient C implementation of csr * csc (in the latest scipy 0.9.0). With 49757 stored elements in Compressed Sparse Row format> Now x_csr and x_dok are 50% sparse: print repr(x_csr) X = ((n) * 2).astype(int).astype(float) # 50% sparse vector if you call transpose(copy=False)), just like with numpy arrays.ĮDIT: some timings via ipython: import numpy, scipy.sparse These use efficient, C implementations under the hood (including multiplication), and transposition is a no-op (esp. Use a scipy.sparse format that is row or column based: csc_matrix and csr_matrix.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |