code: def write_discrete_trajectory(filename, dtraj):
      r
      dtraj=np.asarray(dtraj)
      with open(filename, 'w') as f:
          dtraj.tofile(f, sep='\n', format='%d')
docs: r"""Write discrete trajectory to ascii file.
  
      The discrete trajectory is written to a
      single column ascii file with integer entries
  
      Parameters
      ----------
      filename : str
          The filename of the discrete state trajectory file.
          The filename can either contain the full or the
          relative path to the file.
  
      dtraj : array-like
          Discrete state trajectory.