SciPy includes functions that read / write sparse matrices in MatrixMarket format using scipy.io module , including mmwrite: http://docs.scipy.org/doc/scipy/reference/generated/scipy.io.mmwrite.html
MatrixMarket is not CSV, but close. It consists of a single-line header C # rows, #cols, # non-zero values, followed by one line for a non-zero value. Each of these rows is a row index, column index, value. You can write a simple script that turns spaces into commas and you will have CSV.
source share