Skip to content Skip to sidebar Skip to footer

Using Pytables, Which Is More Efficient: Scipy.sparse Or Numpy Dense Matrix?

When using pytables, there's no support (as far as I can tell) for the scipy.sparse matrix formats, so to store a matrix I have to do some conversion, e.g. def store_sparse_matrix(

Solution 1:

Borrowing from Storing numpy sparse matrix in HDF5 (PyTables), you can marshal a scipy.sparse array into a pytables format using its data, indicies, and indptr attributes, which are three regular numpy.ndarray objects.


Post a Comment for "Using Pytables, Which Is More Efficient: Scipy.sparse Or Numpy Dense Matrix?"