I have got an output using sparse matrix in python, i need to store this sparse matrix in my hard disk, how can i do it? if i should create a database then how should i do?? thi
Depending on the size of the sparse matrix, I tend to just use cPickle
to pickle the array:
import cPickle
f = open('spmatrix.pkl','wb')
cPickle.dump(your_matrix,f,-1)
f.close()
If I'm dealing with really large datasets then I tend to use netcdf4-python
Edit:
To then access the file again you would:
f = open('spmatrix.pkl','rb') # open the file in read binary mode
# load the data in the .pkl file into a new variable spmat
spmat = cPickle.load(f)
f.close()