Advertisement

datamatrix.io

Reading and writing DataMatrix objects from and to file.

function readpickle(path)

Reads a DataMatrix from a pickle file.

Example:

dm = io.readpickle('data.pkl')

Arguments:

  • path -- The path to the pickle file.

Returns:

function readtxt(path, delimiter=u',', quotechar=u'"', default_col_type=)

Reads a DataMatrix from a csv file.

Example:

dm = io.readtxt('data.csv')

Arguments:

  • path -- The path to the pickle file.

Keywords:

  • delimiter -- The delimiter characer.
    • Default: ','
  • quotechar -- The quote character.
    • Default: '"'
  • default_col_type -- The default column type.
    • Default:

Returns:

A DataMatrix.

function readxlsx(path, default_col_type=)

Reads a DataMatrix from an Excel 2010 xlsx file.

Example:

dm = io.readxlsx('data.xlsx')

Arguments:

  • path -- The path to the xlsx file.

Keywords:

  • default_col_type -- The default column type.
    • Default:

Returns:

A DataMatrix.

function writepickle(dm, path, protocol=-1)

Writes a DataMatrix to a pickle file.

Example:

io.writepickle(dm, 'data.pkl')

Arguments:

  • dm -- The DataMatrix to write.
  • path -- The path to the pickle file.

Keywords:

  • protocol -- The pickle protocol.
    • Default: -1

function writetxt(dm, path, delimiter=u',', quotechar=u'"')

Writes a DataMatrix to a csv file.

Example:

io.writetxt(dm, 'data.csv')

Arguments:

  • dm -- The DataMatrix to write.
  • path -- The path to the pickle file.

Keywords:

  • delimiter -- The delimiter characer.
    • Default: ','
  • quotechar -- The quote character.
    • Default: '"'

function writexlsx(dm, path)

Writes a DataMatrix to an Excel 2010 xlsx file. The first sheet will contain a regular table with all non-series columns. SeriesColumns are saved as individual sheets.

Example:

io.writexlsx(dm, 'data.xlsx')

Arguments:

  • dm -- The DataMatrix to write.
  • path -- The path to the xlsx file.