pwtools.arrayio.writetxt

pwtools.arrayio.writetxt(fn, arr, axis=-1, maxdim=3, header=True)[source]

Write 1d, 2d or 3d arrays to txt file.

If 3d, write as 2d chunks. Take the 2d chunks along axis. Write a commented out ini-style header in the file with infos needed by readtxt() to restore the right shape.

Parameters:
  • fn (filename)

  • arr (nd array)

  • axis (axis along which 2d chunks are written)

  • maxdim (highest number of dims that arr is allowed to have)

  • header (bool) – Write ini style header. Can be used by readtxt().