Search code examples
pythonnumpysparse-matrix

how to view sparse matrices outside python environment


I am working with sparse matrices which are 11685 by 85730 . I am able to store it only as a .pickle file . I want to view the file outside the python environment also . I tried saving as a .txt and .csv files but they are of no help . Can anybody suggest a suitable format and library so that I can view those matrices outside the python environment .


Solution

  • Python allows you to write to many formats that are readable outside of python. .csv is one format, but there are also HDF5 and netcdf4 among others (those are meant to store array data though).

    http://code.google.com/p/netcdf4-python/

    http://code.google.com/p/h5py/

    Or you could save them in a matlab readable format:

    http://docs.scipy.org/doc/scipy/reference/tutorial/io.html

    What you use should depend on how you plan on accessing the data outside of python.