Input/Output

This module contains some functions to read and write csarray objects in various file formats.

Functions

sppy.io.mmread(filename, storagetype='col')

Read from a matrix market file. Note that we do not allow comments (%) in the body of the elements, only in the header lines.

Parameters:
  • filename – The filename of the matrix market file.
  • storagetype – The desired storage type (“row” or “col”) of the output matrix.
sppy.io.mmwrite(filename, A, comment='', field=None, precision=None)

Write a csarray object in matrix market format.

Parameters:
  • filename – The filename of the matrix market file.
  • A – The csarray object to write
  • comment – A comment to add to the header of the file.
  • field – The type of values to write out either “integer” or “real”. If None the type is inferred from A.
  • precision – If A stores real numbers, this is the precision to use when writing to file.

Table Of Contents

Previous topic

Linear Algebra module

This Page